NN Parameter & FLOPs Counter

Count the parameters and forward-pass FLOPs of a neural network layer by layer, then see how much RAM or VRAM it needs to run or train — from a small CNN to a 7B-parameter LLM.

Already know the parameter count? Use the quick estimate first. Otherwise build your model below and press Calculate. Everything runs in your browser.

New to neural networks? Read the plain-English guide — no background needed.

This tool answers one question: "Will this AI model fit on my computer or GPU, and how heavy is it?" A model is made of millions or billions of stored numbers (parameters). Each number takes up memory, so more parameters means more memory.

  1. 1. Pick a starting point

    Click a preset (for example Llama 2 7B or CNN) so the table is already filled in. You can change anything afterwards.

  2. 2. Or just try the Quick estimate

    If you only know the size of a model (say 7 billion parameters), type it into the Quick estimate box at the top. It tells you instantly how much memory it needs.

  3. 3. Open More options

    Set your batch size (how many inputs you process at once), the precision (FP16 is a good default) and, if you want training numbers, the optimizer.

  4. 4. Press Calculate

    Nothing is calculated until you press the button. The results appear below in three tabs.

  5. 5. Read the result

    Start with the five big boxes and the 'Will it fit?' dials. Green = fits comfortably, red = does not fit on that GPU.

Rule of thumb to remember: memory ≈ parameters × bytes per number. A 7-billion-parameter model in FP16 (2 bytes each) needs about 14 GB just to load. Every unfamiliar word is explained in the guide below the tool.

Quick estimate — how much memory does a model with N parameters need?

PrecisionWeightsInference (≈ +20%)Smallest GPU that fits
FP3226.1 GB31.3 GBRTX 5090
FP16 / BF1613.0 GB15.6 GBT4 / RTX 4060 Ti 16 GB
INT86.52 GB7.82 GBRTX 3070 / 4060
INT43.26 GB3.91 GBRTX 3070 / 4060
Training (Adam)≈ 16 bytes per parameter = 104.3 GB before activations

Model — layers run top to bottom; shapes are tracked for you

Not sure what to enter? Click a preset above first. Input is what you feed the model: a picture (height × width × colour channels), a piece of text (number of tokens, roughly ¾ of a word each), or a plain list of numbers. Each grey line under a layer explains in plain words what that layer does.

1

A lookup table that turns each word/token ID into a list of numbers. Often the biggest layer in small language models.

2

Tells the model the order of words in a sentence.

3

The building block of ChatGPT-style models: attention (which words matter) plus a feed-forward network. Stack many with 'Repeat ×'.

4

Same idea as BatchNorm but used inside language models (Transformers).

5

Every input is connected to every output. The basic building block of most networks, and where most parameters live in an MLP.

Build your model above and press Calculate to see parameters, FLOPs and memory.

The plain-English guide

Read this once and you will understand most of what the tool shows you. Think of an AI model as a giant recipe book: the parameters are the numbers written in the book, the memory is the shelf space needed to hold the book, and the FLOPs are how many calculations you do each time you cook one dish.

When, how and why to use this counter

When: before you buy or rent a GPU, choose a quantization level, download a model, or decide if you can fine-tune one on your own hardware. How: pick a preset or enter your layers, open More options for batch size and precision, then press Calculate. Why: parameters decide the weight memory, FLOPs decide the compute time, and batch size and context length decide the activation and KV-cache memory.

Key words, explained simply

Parameter (weight)

One learned number inside the model. Total parameters tell you how 'big' the model is. Example: a 7B model has 7,000,000,000 of them.

Layer

One step in the chain. The model passes your data through layers one after another. Different layer types do different jobs (see the layer guide below).

Inference

Using a finished model to get an answer (chatting, classifying an image). Needs much less memory than training.

Training

Teaching the model by adjusting its parameters. Needs 3–6× more memory than inference because it also stores gradients and optimizer data.

FLOPs / MACs

A count of maths operations. FLOPs = floating-point operations. More FLOPs = slower and more energy. One MAC (multiply + add) = 2 FLOPs. This tool shows FLOPs for one input.

RAM vs VRAM

RAM is your computer's memory; VRAM is your graphics card's memory. Models run fastest from VRAM, so VRAM size decides which models you can run.

Precision (FP32, FP16, INT8, INT4)

How many bytes are used to store each number: FP32 = 4, FP16/BF16 = 2, INT8 = 1, INT4 = half a byte. Smaller = less memory, slightly less accuracy.

Quantization

Storing a model in a smaller precision (like INT4) to make it fit on cheaper hardware.

Activations

The temporary results each layer produces while running. They grow with batch size, image size and context length.

Batch size

How many inputs are processed together. Bigger batch = faster overall, but more activation memory.

Context length

For language models: how many tokens (word pieces) the model can look at at once. Longer context = bigger KV cache.

KV cache

Memory a chat model uses to remember the conversation so far so it doesn't redo the work. Grows with context length and batch size.

Gradients & optimizer state

Extra data kept only during training. Gradients say how to change each parameter; Adam also keeps two more numbers per parameter.

Overhead

Extra memory the software itself uses (buffers, fragmentation). The tool adds 10% by default; real life can be 10–30%.

A worked example you can check by hand

Question: can I run a 7-billion-parameter model on a 12 GB graphics card?

  1. 7 billion parameters × 2 bytes (FP16) = 14 GB for the weights alone. That is already more than 12 GB, so no.
  2. Switch to INT8: 7B × 1 byte = 7 GB, plus about 20% extra = ≈ 8.4 GB. It fits.
  3. Switch to INT4: 7B × 0.5 byte = 3.5 GB, plus 20% = ≈ 4.2 GB. It fits with lots of room for a long chat.
  4. Want to train it instead? About 16 bytes per parameter = ≈ 112 GB before activations, so you would need multiple big GPUs or a lighter method.

Why the tool may show slightly smaller numbers (for example 13 GB instead of 14 GB): it counts in GiB, where 1 GB = 1,073,741,824 bytes, which is how GPU memory is usually measured.

What each layer type does

Dense / LinearEvery input is connected to every output. The basic building block of most networks, and where most parameters live in an MLP.
Conv2DSlides small filters over an image to detect edges, textures and shapes. Few parameters, but many calculations.
Pooling 2DShrinks an image by keeping only the strongest value in each small window. No parameters.
Global avg poolAverages each channel into a single number so the image becomes a short vector. No parameters.
FlattenUnrolls an image or grid into one long list of numbers. No parameters.
BatchNormKeeps numbers in a stable range so training is smoother. Tiny number of parameters.
LayerNorm / RMSNormSame idea as BatchNorm but used inside language models (Transformers).
EmbeddingA lookup table that turns each word/token ID into a list of numbers. Often the biggest layer in small language models.
Positional embeddingTells the model the order of words in a sentence.
LSTM / GRU / RNNReads a sequence step by step and keeps a memory of what it saw. Used for text, audio and time series.
Transformer blockThe building block of ChatGPT-style models: attention (which words matter) plus a feed-forward network. Stack many with 'Repeat ×'.
Activation / DropoutAdds non-linearity (ReLU, GELU) or randomly switches units off (Dropout). Has no parameters, so it changes no numbers here.

How to read your results

Total parameters

The model's size. Roughly 1 million = tiny, 100 million = mid-size, 7 billion or more = a full language model.

Forward FLOPs

How much maths for one input. Compare two models: the one with fewer FLOPs is faster on the same hardware.

Inference memory

The minimum VRAM/RAM to run the model. Leave a little spare; if you are within 10% of your GPU size, expect trouble.

Training memory

Always much larger. If it is too big, try a smaller batch, a lighter optimizer, or fine-tune only part of the model (LoRA).

Dials (green to red)

Green: fits comfortably. Yellow/orange: barely fits. Red: does not fit on that card.

Layers tab

Shows which layer holds most of the parameters, so you know where shrinking the model helps the most.

Common beginner mistakes

  • Comparing training memory with inference memory. They are very different numbers.
  • Forgetting the KV cache: a chat model with a very long context can use as much memory as its weights.
  • Assuming INT4 is free. It saves a lot of memory but can slightly reduce answer quality.
  • Treating the result as exact. It is a good estimate; real programs add some extra overhead.

How this calculator works

Each layer's parameters follow its standard formula — Dense: in × out + bias; Conv2D: k × k × Cin × filters + bias; LSTM: 4 × (in × u + u × u + u); Transformer block: attention projections + feed-forward + norms. Output shapes are propagated so each layer sees the right input size.

Memory = parameters × bytes per weight, plus activations, KV cache and a configurable overhead. Training adds gradients, optimizer state (Adam: two FP32 values per parameter) and stored activations. Nothing is calculated until you press Calculate.

Common questions