Neural Network Parameter Count Calculator

Calculate the total number of trainable parameters in a feedforward neural network. Enter the number of neurons in each layer (including input and output layers), separated by commas.

First value = input layer, last value = output layer, middle values = hidden layers
Enter layer sizes above and click Calculate.

Formulas

Dense (Fully Connected) Layer:

params = (n_in × n_out) + n_out
         └─ weights ─┘ └ biases ┘

Where n_in = neurons in previous layer, n_out = neurons in current layer.

Convolutional Layer:

params = (K × K × C_in × C_out) + C_out
         └────── weights ──────┘ └ biases ┘

Where K = kernel size, C_in = input channels, C_out = output filters.

Total Parameters:

Total = Σ params(layer_i)   for all layers i = 1 to L

Memory Estimate (float32):

Memory = Total_params × 4 bytes

Assumptions & References

  • Each dense layer connects every neuron in the previous layer to every neuron in the next layer (fully connected).
  • Each neuron in a dense layer has one bias term per output neuron (not per input).
  • Convolutional layers use 2D kernels of size K×K with shared weights across spatial positions.
  • Each convolutional filter has one bias term regardless of kernel size or input channels.
  • Memory estimate assumes 32-bit floating point (float32, 4 bytes per parameter), which is standard for training.
  • This calculator counts only trainable parameters; batch normalization, dropout, and activation functions add no trainable parameters (except BatchNorm's γ and β, not included here).
  • Pooling layers have zero trainable parameters and are not counted.
  • Reference: Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep Learning. MIT Press. Chapter 6 (Feedforward Networks), Chapter 9 (CNNs).
  • Reference: LeCun, Y. et al. (1998). Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11), 2278–2324.

In the network