GPT-4 Token Counter
Exact counts for GPT-4, GPT-4 Turbo and GPT-3.5, in your browser.
Runs entirely in your browser
Loading the tool…
- —Tokens
- —Characters
- —Words
- —Characters per token
Each level includes the ones before it.
- —Tokens before
- —Tokens after
- —Saved
- —Reduction
Read this before you use the output. Removing a word can change what a model does, and the sentences that compress worst are the ones carrying your constraints.
Show the tokens themselves
Every coloured block is one token. This is the split the model sees, which is why a long number costs more than a long word.
This is the same counter as the main one,
carrying a different vocabulary. GPT-4, GPT-4 Turbo, GPT-3.5-turbo and the
text-embedding-3 models tokenise with
cl100k_base, which has 100,256 entries against o200k_base's
199,998, and cuts text differently enough that using the wrong one gives a
wrong number with no warning.
The difference is not small. cl100k splits mixed-case words and non-Latin text more finely, so the same paragraph can differ by several per cent between the two, and by a great deal more if it is Chinese, Japanese or Korean. If you are budgeting a system prompt against a specific model, the vocabulary has to match the model.
A smaller vocabulary is also a smaller page: this one carries 446 KB of compressed tokeniser against a megabyte on the newer encoding. Everything else is identical, the reducer included.
How to use it
- Paste your prompt. The token count updates as you type.
- Pick a reduction level. Each one includes the ones before it.
- Read the diff, then copy the reduced prompt if you are happy with it.
Questions
Which models use cl100k_base?
GPT-4, GPT-4 Turbo, GPT-3.5-turbo, and the text-embedding-3 and text-embedding-ada-002 models. Anything newer than those, meaning GPT-5, GPT-4o, GPT-4.1, o1 and o3, uses o200k_base and belongs on the main token counter instead.
How different are the two counts?
Usually a few per cent on English prose, and far more on anything else. o200k_base has twice as many entries, so it represents common sequences in one token where cl100k needs two, and the gap widens sharply on Chinese, Japanese and Korean text. Counting a GPT-4 prompt with the newer vocabulary will generally under-count it.
Is this exact?
Yes, and it is tested rather than asserted. The vocabulary is OpenAI's published cl100k_base and the encoder implements the same byte-pair encoding and pre-tokenisation rules. Both encodings are checked against tiktoken over 1,587 cases each, and the build fails if a single one disagrees.
The newer vocabulary
The same counter and the same reducer, carrying the vocabulary the current models use.
Your data stays on your device
Everything above runs inside your browser as WebAssembly compiled from Rust. Nothing you type is uploaded, logged or stored on a server. You can load this page once, go offline, and it still works.
This page makes no requests at all, to anywhere. That is not a promise in the copy: it is a Content-Security-Policy header your browser enforces, and connect-src on it is none. Open the network tab and watch nothing happen.