Convolution Output Size Calculator

Model convolution layers across common neural architectures. Review formulas, examples, downloads, and dynamic sizing charts. Plan tensor shapes early and reduce debugging surprises later.

Calculator inputs

This advanced tool covers standard and transposed convolution, asymmetric padding, dilation, groups, bias, and format-aware tensor output.

SAME is intended for standard convolution.

Formula used

For a standard convolution, each spatial axis follows this rule:

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

When ceil mode is enabled, the calculator replaces floor with ceil.

effective_kernel = dilation × (kernel - 1) + 1


For a transposed convolution, each spatial axis follows this rule:

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

This page calculates height and width independently, then assembles the final tensor using the selected data format.

How to use this calculator

  1. Choose standard or transposed convolution.
  2. Enter input size, channels, kernel, stride, dilation, and groups.
  3. Select VALID, SAME, or EXPLICIT padding.
  4. Add output padding only for transposed convolution.
  5. Pick NCHW or NHWC to match your framework.
  6. Click the calculate button. The result appears above the form with a graph and export buttons.

Example data table

Layer Input Kernel Stride Padding Dilation Output
Standard 224 × 224 3 × 3 1 × 1 SAME 1 × 1 224 × 224
Standard 224 × 224 3 × 3 2 × 2 SAME 1 × 1 112 × 112
Standard 32 × 32 5 × 5 1 × 1 VALID 1 × 1 28 × 28
Transposed 28 × 28 4 × 4 2 × 2 Explicit 1,1,1,1 1 × 1 56 × 56

FAQs

1. What does SAME padding do?

SAME padding adds enough border pixels to preserve spatial size when stride is one. With larger strides, it usually keeps the output close to ceil(input / stride), which many deep learning frameworks use for shape planning.

2. Why does dilation reduce output size?

Dilation spaces kernel elements farther apart, increasing the effective kernel size. A larger effective kernel consumes more spatial extent, so the output gets smaller unless you compensate with more padding.

3. What is output padding in transposed convolution?

Output padding resolves shape ambiguity after upsampling. It does not add trainable weights. It only increases the final reported spatial size by a small amount, usually less than the stride.

4. Do groups change output height and width?

No. Groups affect channel connectivity and parameter count, not the spatial size formula. They still matter because both input channels and output channels must be divisible by the group count.

5. Why can the calculator return an invalid shape?

If the effective kernel is too large for the padded input, the formula may produce zero or negative dimensions. That usually means the layer settings are not feasible for the current tensor size.

6. Should I use NCHW or NHWC?

Use the format expected by your framework or deployment target. The spatial result stays the same. Only the reported tensor ordering changes, which helps avoid shape mismatches in model code.

7. What is the receptive field shown here?

For one convolution layer, the receptive field equals the effective kernel size on each axis. It shows how much of the input can influence one output location before stacking additional layers.

8. Why graph output size against stride?

Stride is one of the fastest ways to change resolution. The chart helps you see how aggressive downsampling or upsampling becomes as stride increases, which is useful during architecture design.

Related Calculators

map distance 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.