Convolution Output Size Calculator

Plan CNN layers without guesswork. Test standard, same, valid, and transposed cases quickly for design. Visualize dimension flow across every convolution stage with clarity.

Calculator Inputs

Configure the convolution layer

Choose one spatial axis, two axes, or three axes.
Use transposed mode for learned upsampling layers.
Same and valid presets are mainly for standard convolution.

Input size


Kernel size


Stride


Dilation


Padding


Output padding for transposed mode

Example Data Table

Sample convolution scenarios

Case Input Kernel Stride Padding Dilation Mode Output
Image feature map 224 × 224 3 × 3 1 × 1 1 × 1 1 × 1 Standard 224 × 224
Downsampling block 32 × 32 5 × 5 2 × 2 Valid 1 × 1 Standard 14 × 14
Volume processing 64 × 64 × 64 3 × 3 × 3 2 × 2 × 2 1 × 1 × 1 1 × 1 × 1 Standard 32 × 32 × 32
Learned upsampling 28 × 28 4 × 4 2 × 2 1 × 1 1 × 1 Transposed 56 × 56
Formula Used

Core equations behind the calculator

Effective kernel per axis: effective_kernel = dilation × (kernel - 1) + 1

Standard convolution: output = floor(((input + pad_before + pad_after - effective_kernel) / stride) + 1)

Transposed convolution: output = ((input - 1) × stride) - pad_before - pad_after + effective_kernel + output_padding

Same padding for standard convolution: output = ceil(input / stride), then total padding is solved from the target output.

Parameter count: kernel_volume × input_channels × output_channels + bias_terms

MACs per sample: output_spatial_volume × output_channels × kernel_volume × input_channels

How to Use

Steps for accurate CNN sizing

  1. Select 1D, 2D, or 3D based on the layer’s spatial axes.
  2. Choose standard convolution for shrinking or preserving size, or transposed convolution for learned upsampling.
  3. Enter input dimensions, channel counts, kernel sizes, stride values, and dilation values.
  4. Pick a padding mode. Use custom for manual control, valid for no padding, or same for shape-preserving standard layers.
  5. Enter output padding only when using transposed convolution.
  6. Press Calculate output size to show the result above the form.
  7. Review the tensor summary, axis table, and graph before implementing the layer in code.
  8. Use the CSV and PDF buttons to save your result for documentation or model review.
FAQs

Common questions

1. What does dilation change in convolution sizing?

Dilation expands the effective kernel without adding learnable weights. A larger dilation increases spacing between kernel elements, which usually reduces standard-convolution output size unless padding also increases.

2. Why can the output become zero or negative?

This happens when the input is too small relative to the effective kernel, stride, and padding setup. The calculator warns you when the configuration is not physically usable.

3. When should I use same padding?

Use same padding when you want a standard convolution to preserve spatial size at stride 1, or to follow ceil-based output sizing when stride is larger.

4. How is transposed convolution different here?

Transposed convolution reverses the spatial shrinking effect and can increase output size. It also allows output padding, which fine-tunes the final dimension after stride-based expansion.

5. Does this calculator work for 1D, 2D, and 3D layers?

Yes. It activates width only for 1D, height and width for 2D, and depth, height, and width for 3D. The same axis-wise formulas are applied consistently.

6. What are effective kernel and kernel volume?

Effective kernel includes dilation, while kernel volume multiplies the raw kernel lengths across active axes. Effective kernel affects output size, while kernel volume affects parameters and MAC estimates.

7. Why do I see MACs instead of FLOPs?

MACs are commonly used for neural-layer cost estimates because each multiply-accumulate pair represents one core operation unit. Many model reports can convert MACs to FLOPs later if needed.

8. Can I use this for framework verification?

Yes. It is useful for checking layer shapes before implementation in deep learning frameworks, reviewing architecture diagrams, and validating tensor transitions during model design.

Related Calculators

batch size calculatorstride calculatorimage size calculatorintersection over unionimage resolution calculatorpixel density calculatorimage resize scaleanchor box sizefeature map sizereceptive field calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.