AI & Computing

Transformer Parameter Count Calculator

Enter the architecture to estimate how many parameters a transformer has.

Your numbers

4 for classic MLPs; about 3.5 for SwiGLU with three matrices (8/3 × 1.5 adjusted)

Your results

Total parameters
Total parameters
—
Per transformer block (millions)
—
Embeddings (millions)
—
Share in embeddings
—

Transformer Parameter Count Calculator by TheCalcTools

How the Transformer Parameter Count Calculator works

Each block has attention projections (query and output d², plus keys and values scaled by the KV-head ratio) and a feed-forward network. Classic MLPs have 2 matrices of d × 4d; SwiGLU networks have 3 matrices of d × (multiplier × d).

Embeddings add vocabulary × width, twice if the output layer is not tied. Layer-norm and bias parameters are tiny and left out.

The formula

Params ≈ L × (attention + MLP) + V × d × (1 or 2)

Worked example

Using the default values shown in the calculator:

Layers32
Model width (d_model)4096
Vocabulary size128000
Feed-forward multiplier3.5
KV heads ÷ heads0.25
Input and output embeddingsSeparate
  1. 32 blocks of 218 million plus 1,049 million in embeddings ≈ 8.028 billion.

Result:

Total parameters8.028 billion
Per transformer block (millions)218.1
Embeddings (millions)1,048.6
Share in embeddings13.1%

Frequently asked questions

Why does my result differ slightly from a published count?

Published counts include norms and biases and use exact intermediate sizes rounded to hardware-friendly numbers.

Sources and further reading

More in AI & Computing · All calculators

This calculator gives estimates for information only. Check important results independently before you rely on them. See our disclaimer.