Token Counter

Count tokens for GPT, Claude, Llama, and Gemini. All in-browser — no API key, no upload.

GPT-4o / 4.1
GPT-4 / 3.5
Claude 3.5 / 4
Llama 3
Gemini 1.5 / 2
0
Tokens
0
Characters
0
Words
0
Chars / Token
Estimate Cost →

How it works: GPT counts use the cl100k_base / o200k_base BPE tokenizer (matching OpenAI's exact counts). Claude, Llama, and Gemini use per-model approximations calibrated against published tokenizer behavior (typically within 1–3% for English text). For production billing, always verify with the provider's official API.

About this tool

This token counter shows how GPT, Claude, Llama, and Gemini models split your text into tokens — the billing and context-window unit for every LLM API. Paste any text and you get token, character, and word counts instantly, entirely in your browser: nothing is uploaded, so it's safe to paste proprietary prompts or private documents.

GPT counts use the actual cl100k_base and o200k_base BPE tokenizers, matching OpenAI's numbers exactly. Claude, Llama, and Gemini counts are calibrated approximations, typically within a few percent for English text.

When to use it

Worked example

Paste a 1,000-word English article and you'll typically see around 1,300–1,400 GPT tokens — English averages roughly 0.75 words per token. The chars/token stat shows density: code and non-English text tokenize less efficiently, often 2–3 characters per token instead of 4, which is why the same byte count can cost twice as much in tokens.

Frequently asked questions

What exactly is a token?

A token is a chunk of text — often a word fragment, common word, or punctuation mark — produced by the model's tokenizer. Models read, generate, and bill in tokens, not characters. "tokenization" might split into "token", "ization", while "the" is a single token.

Why do different models report different counts for the same text?

Each model family uses its own tokenizer with a different vocabulary. GPT-4o's o200k_base vocabulary is larger than GPT-4's cl100k_base, so it usually needs slightly fewer tokens for the same text. Claude, Llama, and Gemini each have their own schemes.

Are the counts here exact?

GPT counts are exact — the page runs the same BPE tokenizers OpenAI uses. Claude, Llama, and Gemini counts are close approximations (usually within 1–3% for English). For production billing, verify against the provider's API response, which reports actual usage.

Is my text sent to a server?

No. The tokenizers run as JavaScript in your browser. Nothing you paste leaves your device, so it's safe to measure confidential prompts and documents.