%3C/text%3E%3C/svg%3E">
💻
💻 Tech & IT

Neural Network Parameter & Memory Calculator

Results update as you type.

Your numbers

Understanding the neural network parameter and memory calculator — concept and principle

Every connection in a fully connected (dense) neural network has a weight, and every neuron has a bias. This calculator counts those learnable parameters for a stack of dense layers and converts the count into memory: how much space the weights take at a chosen numeric precision, and a rough figure for training with the Adam optimiser. It helps you check whether a model fits on a device.

Parameters of a 784-256-128-10 networkEach dense layer has inputs × outputs weights plus one bias per output: 200,960 + 32,896 + 1,290 = 235,146 parameters, 0.94 MB at 4 bytes each (FP32).Each layer: in × out weights + out biases78425612810inputoutputhidden784×256 + 256200,960256×128 + 12832,896128×10 + 101,290235,146 params × 4 B = 0.94 MB
Three layers add up to 235,146 parameters, 0.94 MB in FP32 (about 3.76 MB to train with Adam).

How it is calculated

Layer sizes are numbers of neurons, listed from the input layer to the output layer.

The principle

A dense layer computes y = Wx + b. The weight matrix W has one entry for every input-output pair, and the bias vector b has one entry per output, which gives in × out + out. Training needs more than the weights: one common accounting is 4 bytes for FP32 weights, 4 for their gradients and 8 for Adam's two running averages (first and second moments), or 16 bytes per parameter. Mixed-precision training rearranges these pieces but also comes to about 16 bytes per parameter. Activations, which depend on batch size, are extra and are not included.

Worked example

  1. Layers 784 → 256 → 128 → 10 (for example, a 28 × 28 image classifier with 10 classes).
  2. 784 × 256 + 256 = 200,960; 256 × 128 + 128 = 32,896; 128 × 10 + 10 = 1,290.
  3. Total = 235,146 parameters.
  4. FP32 weights: 235,146 × 4 = 940,584 bytes = 0.940584 MB.
  5. Adam training: 235,146 × 16 = 3,762,336 bytes = 3.762336 MB.

How to read the result

Notice that the first layer holds about 85% of the parameters: large input layers dominate the count. Halving the precision halves the weights memory, which is why FP16 and INT8 are used for deployment. MB here means 10⁶ bytes; operating systems often show MiB (2²⁰ bytes), about 4.9% larger.

Common mistakes

Keep in mind: These are estimates for plain dense layers. Real frameworks add buffers, workspace and fragmentation, and architectures such as convolutions, attention or embeddings follow different formulas.

Frequently asked questions

Do batch-normalisation layers add parameters?

Yes, two learnable values per channel (scale and shift), plus two stored running statistics.

Does quantisation to INT8 change the parameter count?

No. It changes the bytes per parameter, not the number of parameters.

Why does SGD use less memory than Adam?

Plain SGD keeps no moment estimates; SGD with momentum keeps one, Adam keeps two.

Sources: I. Goodfellow, Y. Bengio and A. Courville, Deep Learning, MIT Press, 2016 · D. P. Kingma and J. Ba, Adam: A Method for Stochastic Optimization, ICLR 2015 · S. Rajbhandari et al., ZeRO: Memory Optimizations Toward Training Trillion Parameter Models, SC20, 2020

Checked 8 Nov 2026. Standard formulas and RFC/IEEE definitions, computed locally in your browser — nothing you type is sent anywhere.

💻 All tech & IT tools →🌍 Calculators by country →