Part of the AI & Machine Learning suite · 36 calculators

LLM Parameter Count Calculator

How many parameters a decoder-only transformer has from its depth, hidden size, feed-forward width and vocabulary — and the memory those weights take at 16-, 8- and 4-bit precision.

Each transformer block has four attention projections of d × d and a feed-forward pair of d × f and f × d; with the usual f = 4d that is 12 d² per layer.

Results update as you type
Results
Parameters
6.57 billion
Parameters (number)
Per layer
Embeddings
Weights in memory (fp16 / int8 / int4)
Reviewed September 2026. Model arithmetic is the same everywhere: the same formulas in every market, in your own currency. The UK regulates AI through existing sector regulators rather than a single AI statute.
No account required · Google Analytics off unless allowedCalculator arithmetic runs in your browserResults update as you type
All calculations run 100% in your browser. The calculator code does not submit your figures to GlobalCalc to obtain a result.
About llm parameter count

How the llm parameter count calculator works

Each transformer block has four attention projections of d × d and a feed-forward pair of d × f and f × d; with the usual f = 4d that is 12 d² per layer. Add the token embedding of vocabulary × d (and the same again if the output head is not tied to it). Layer norms and biases add a rounding error. A 32-layer, 4,096-wide model with a 32k vocabulary comes to about 6.6 billion parameters — the shape of a “7B” model.

Formula: per layer ≈ 4d² + 2 d f; total ≈ L (4d² + 2df) + V d (× 2 if untied)

Worked examples

InputsParametersNote
32 layers, d 4,096, 32k vocab, tied6.57 billion6.57 billion
GPT-2 small: 12 layers, d 768, 50k vocab123.53 million124 million
80 layers, d 8,192, untied 128k vocab66.52 billion66.5 billion

Frequently asked questions

Why does the count come out under the advertised size?

Marketing rounds up, and architectures vary: gated feed-forward layers (SwiGLU) use three matrices with f ≈ 2.7d, grouped-query attention shrinks the K and V projections, and some models untie the output head. Enter your model’s real f and tying to get closer.

How much memory do I need to run it?

The weights row is the floor; inference also needs the KV cache (see that calculator) and working buffers, typically another 10–30%. Training needs several times more for optimiser states and gradients.

Does the parameter count predict quality?

Roughly, at the same training data — scaling laws tie loss to parameters and tokens together. A smaller model trained on far more tokens often beats a larger one trained on fewer.

What about mixture-of-experts models?

They have many more total parameters than they use per token: count the experts’ feed-forward layers into the total, but only the active experts into the per-token compute.

Where these figures come from

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.