Token Counter
Paste any prompt, document or code and get an instant token estimate, the cost of sending it as input across popular models (Claude, GPT-4o, Gemini, Llama), and how much of each context window — 8K to 1M — it consumes. Tuned heuristics for prose vs code, no signup, nothing leaves your browser.
| Model | $ / 1M input | This text |
|---|---|---|
| Claude Opus 4 | $15.00 | $0.001440 |
| Claude Sonnet 4 | $3.00 | $0.000288 |
| Claude Haiku 3.5 | $0.8000 | $0.000077 |
| GPT-4o | $2.50 | $0.000240 |
| GPT-4o mini | $0.1500 | $0.000014 |
| Gemini 2.5 Pro | $1.25 | $0.000120 |
| Gemini 2.5 Flash | $0.3000 | $0.000029 |
| Llama 3.1 70B | $0.6000 | $0.000058 |
Why models count in tokens, not words
A language model never sees words or letters — its tokenizer splits text into sub-word chunks from a fixed vocabulary, and the model reads and writes only those. Common words ("the", "and") are usually one token; rarer or longer words split into pieces ("engineer" might be engine + er). That's why models are priced per token, capped per token, and — famously — bad at counting the letters in "strawberry": they never saw letters.
The rules of thumb that actually hold
For English prose, 1 token ≈ 4 characters ≈ ¾ of a word — so 100 tokens is roughly 75 words, and a page of text is ~400–500 tokens. Code is denser: symbols, brackets and unusual identifiers each cost tokens, so figure ~3 characters per token. Non-Latin scripts vary wildly — CJK text often runs close to one token per character, which is why the same sentence can cost 3× more in Japanese than English.
Why an estimate is enough
There is no single true count anyway: GPT models use one tokenizer family, Claude another, Gemini a third, and the same text tokenizes differently in each. Exact counts only come from running the target model's own tokenizer. For everything you actually do with a count — budgeting a prompt against a window, estimating an API bill, deciding whether to chunk a document — a ±15% estimate answers the question.
From tokens to dollars and windows
Two numbers turn a token count into a decision. Cost: input tokens × the model's per-million input price (the table above uses current list prices — sending 10K tokens to a frontier model costs real money at scale; to a mini model, fractions of a cent). Fit: tokens ÷ context window. A prompt that's 2% of a 1M window is trivially safe; one that's 80% of an 8K window leaves no room for history, tools — or the answer.
How it works
- 1 token ≈ 4 characters of English ≈ ¾ of a word; code is denser (~3 chars).
- CJK text counts roughly one token per character.
- Costs use list prices per 1M input tokens, matching the pricing comparator.
- Everything runs locally in your browser — nothing is uploaded.
Frequently asked questions
How many tokens is a word?
For English prose, roughly 1.3 tokens per word — or about 4 characters per token. Common short words are usually one token; longer or rarer words split into several sub-word pieces. Code runs denser (more symbols and identifiers), closer to 3 characters per token.
How accurate is this estimate?
Within about ±15% for typical English text and code. Every model family uses a different tokenizer (GPT's cl100k/o200k, Claude's own, Gemini's SentencePiece), so no single exact count exists across models anyway — for budgeting prompts, caps and costs, a good estimate is what you actually need.
Why do token counts matter?
Everything about an LLM is priced and limited in tokens: API cost is per million input/output tokens, the context window caps how much you can send, and latency grows with input length. Knowing whether a prompt is 500 or 50,000 tokens is the difference between a cheap fast call and a rejected request.
Is my text uploaded anywhere?
No. The counter runs entirely in your browser — nothing you paste is sent to any server, logged, or stored. You can paste confidential prompts or proprietary code safely.