Convolution Output Size Calculator
The output size of a convolutional layer from its kernel, stride, padding and dilation — repeated through a stack — with the receptive field each layer sees and the parameters it holds.
Each convolution shrinks or keeps its input by one formula: floor((n + 2p − d(k − 1) − 1) / s) + 1.
How the convolution output size calculator works
Each convolution shrinks or keeps its input by one formula: floor((n + 2p − d(k − 1) − 1) / s) + 1. Padding of (k − 1)/2 with stride 1 keeps the size; stride 2 halves it. Stacking layers grows the receptive field — the patch of the original image a single output pixel depends on — and it grows faster once strides accumulate.
The parameter count is where memory goes: kernel area times input channels times output channels, plus a bias per output channel.
Formula: out = ⌊(n + 2p − d(k−1) − 1) / s⌋ + 1; RF_L = RF_{L−1} + d(k−1) × Π strides before L; params = k² C_in C_out + C_out
Worked examples
| Inputs | Output size after the stack (px) | Note |
|---|---|---|
| Four stride-2 layers on 224 | 14 | 14 px, receptive field 31 |
| Same-size convolutions | 224 | size kept, RF 7 |
| Dilated | 224 | RF grows faster |
FAQFrequently asked questions
How do I calculate a convolution's output size?
Floor of (input + 2 × padding − dilation × (kernel − 1) − 1) over stride, plus one. Same for height and width; this page assumes a square input.
What padding keeps the size?
(kernel − 1) / 2 with stride 1 — one pixel for a 3 × 3 kernel, three for a 7 × 7. Frameworks call it "same" padding.
What is the receptive field?
The region of the original input that one output value depends on. It grows by (kernel − 1) times the product of all earlier strides at each layer, which is why strided layers expand it fast.
What does dilation do?
It spreads the kernel's taps apart, so a 3 × 3 kernel with dilation 2 covers a 5 × 5 area with nine parameters — a cheap way to grow the receptive field.
Where do the parameters come from?
Each output channel has one kernel per input channel plus a bias: kernel area × C_in × C_out + C_out. Channels dominate; a 3 × 3 layer from 256 to 256 channels is 590k parameters.
Where these figures come from
- Vaswani et al. (2017) — Attention Is All You Need — the transformer architecture the memory arithmetic follows
- Kaplan et al. (2020) — Scaling Laws for Neural Language Models — the compute relationship used for training estimates
- Hoffmann et al. (2022) — Training Compute-Optimal Large Language Models — the tokens-per-parameter guidance ("Chinchilla")
- IEEE 754 — Standard for Floating-Point Arithmetic — the numeric formats behind bytes per parameter
- National AI Centre — Australia's national AI body
Last checked: September 2026. The relationships here are architectural, not vendor-specific: bytes per parameter follow the numeric format, KV-cache size follows the transformer definition, and token-per-word ratios come from published tokeniser behaviour.