ToolSphere

Neural Network Parameter & FLOPs Calculator

Student tools

Estimate trainable parameters, weights, biases, and forward-pass FLOPs for fully-connected neural networks. Supports custom layer sizes and batch sizes.

Neural network parameter & FLOPs calculator

Estimates total trainable parameters and forward-pass FLOPs for a fully-connected (dense) network from its layer sizes.

Total parameters
235.15K (235,146)
FLOPs per sample (forward pass)
469.90K
Total FLOPs (batch of 1)
469.90K
LayerShapeParametersFLOPs (per sample)
1784 → 256200,960401,664
2256 → 12832,89665,664
3128 → 101,2902,570

FLOPs counted as 2 per multiply-add (industry convention). Only covers fully-connected layers — convolutional/attention layers have different FLOP formulas not modeled here.

On this browser only

Give feedback

Did this tool help?

Tell us what worked, what didn’t, or what you’d like next.

Opens Google Forms in a new tab with this tool’s name filled in. No sign-in or email required. Feedback is optional.

How to use Neural Network Parameter & FLOPs Calculator

  1. 1Enter your network's layer sizes as a comma-separated list, from input to output.
  2. 2Optionally set a batch size to see total FLOPs for a batch, not just one sample.
  3. 3Review the per-layer parameter and FLOPs breakdown.

About Neural Network Parameter & FLOPs Calculator

Neural Network Parameter & FLOPs Calculator

Computes total trainable parameters (weights + biases) and estimated forward-pass FLOPs for a fully-connected (dense) network, given only its layer sizes. FLOPs are counted as 2 per multiply-add, the standard convention used in most model efficiency reporting.

Covers dense/linear layers only — convolutional and attention layers have different FLOP formulas not modeled by this calculator.

Why parameter count and FLOPs are different numbers

Parameters tell you how much memory a model occupies; FLOPs tell you how much arithmetic it takes to run. They are correlated for fully-connected networks but not interchangeable, and the distinction decides which constraint you are actually hitting.

A model that will not fit on a device is a parameter problem — at 32-bit precision, every parameter costs 4 bytes, so a 100-million-parameter network needs around 400 MB before activations and optimizer state. A model that fits but runs too slowly is a FLOPs problem, solved by making the network shallower or narrower rather than by quantisation.

What the number covers, and what it leaves out

This counts the multiply-accumulate work in the dense layers: for a layer mapping n inputs to m outputs, n×m multiplications and the same number of additions, counted as 2 FLOPs per pair, plus the bias terms. That is the convention used in efficiency papers, so the figure is comparable with published numbers.

It deliberately excludes activation functions, normalisation layers, softmax and elementwise operations. Those are cheap in FLOPs but not free in wall-clock time — in practice they are memory-bandwidth bound, and a network dominated by them can run far slower than its FLOP count suggests. Treat FLOPs as a measure of arithmetic work, not a prediction of runtime.

Training costs roughly three times inference

The figure here is the forward pass. A training step also runs a backward pass, which computes gradients with respect to both the inputs and the weights and costs approximately twice the forward pass again. The usual rule of thumb is that one training step is about three times the forward-pass FLOPs — useful for estimating the cost of a training run before committing to it.

Guides and tutorials

Frequently asked questions

Why is a FLOP counted as 2, not 1?

Each weight contributes one multiplication and one addition to the output sum — by convention, model efficiency papers count this multiply-accumulate as 2 FLOPs, not 1.

Does this work for convolutional or transformer models?

No — this calculator only models fully-connected (dense) layers. Convolutional layers' FLOPs depend on kernel size and spatial dimensions, and attention layers have their own distinct formula, neither of which is covered here.

Should I optimize for parameters or FLOPs?

Whichever is your constraint. A model that will not fit in memory is a parameter problem; one that fits but runs too slowly is a FLOPs problem. They are correlated but not the same, and the fix differs.

Why does my model run slower than the FLOP count suggests?

Because activations, normalisation and elementwise operations are excluded here — they are cheap in arithmetic but memory-bandwidth bound, and they often dominate real runtime.

How do I estimate training cost from this?

Roughly three times the forward-pass figure per step: the backward pass computes gradients with respect to both inputs and weights and costs about twice the forward pass again.

Have a suggestion for Neural Network Parameter & FLOPs Calculator?Share your feedback ↗