Free tool · browser-only calculation
Conv2d output size calculator for CNN layers
Calculate output shape and parameters for Conv1d, Conv2d, ConvTranspose2d and pooling, with stacked layers and PyTorch export. With guided examples and.
Result
How the calculation works
Formula as plain text
W_{out}=\left\lfloor\frac{W+2P-D(K-1)-1}{S}\right\rfloor+1Convolution output shape depends on input, kernel, stride, padding and dilation. The formula subtracts the effective kernel size, divides by stride and adds the starting point. Pooling supports ceil_mode, while transposed convolution uses a different relation and includes output_padding.
Stacking layers shows where geometry changes. Stride reduces the map, dilation expands the receptive field without increasing the kernel and output channels correspond to filters. Parameter counting separates weights and bias: Conv2d uses k_h·k_w·C_in·C_out, plus C_out when bias is enabled.
The tool also detects fractional or non-positive dimensions and generates `nn.Sequential` from your configuration. Everything runs locally in the browser and no data is sent to a server. URL parameters preserve and share the complete layer sequence.