LLM Token Counter
Updated Free mock REST & WebSocket APIs
Paste a prompt, a document or code to see how many tokens it uses across today's main models — exact for OpenAI (tiktoken), carefully estimated for Claude, Gemini, Llama, Mistral and DeepSeek — plus how much of each context window it fills and what it costs as input.
Tokens, context window and input cost by model
| Model | Tokens | Context used | Input cost |
|---|---|---|---|
GPT-6 Astra OpenAI | ≈62 | <0.01% of 1.05M | $0.00062 |
GPT-6 Sol OpenAI | ≈62 | <0.01% of 1.05M | $0.00012 |
GPT-5.4 mini OpenAI | ≈62 | 0.02% of 400K | $4.6e-5 |
GPT-4o OpenAI | ≈62 | 0.05% of 128K | $0.00015 |
Claude Fable 5.1 Anthropic | ≈93 | <0.01% of 1M | $0.00093 |
Claude Opus 5.5 Anthropic | ≈93 | <0.01% of 1M | $0.00037 |
Claude Sonnet 5.5 Anthropic | ≈93 | <0.01% of 1M | $0.00019 |
Claude Sonnet 4.6 Anthropic | ≈72 | <0.01% of 1M | $0.00022 |
Claude Haiku 5.5 Anthropic | ≈93 | <0.01% of 1M | $9.3e-6 |
Gemini 4 Argon Google | ≈65 | <0.01% of 1M | $0.00013 |
Gemini 3.8 Flash Google | ≈65 | <0.01% of 1M | $4.9e-5 |
Mistral Large 4 Mistral | ≈69 | <0.01% of 1M | $4.7e-5 |
Llama 3.3 70B Meta (Llama) · Together AI | ≈65 | 0.05% of 128K | $6.8e-5 |
DeepSeek V4 Pro DeepSeek | ≈69 | <0.01% of 1M | $9.1e-5 |
Grok 4.7 xAI | ≈65 | 0.01% of 500K | $0.00013 |
Prices checked on 2026-10-18 from each provider's official pricing page (standard tier, USD per 1M tokens). Prices change often — verify before you budget.
OpenAI counts are exact (tiktoken o200k_base / cl100k_base). Claude, Gemini, Llama, Mistral, DeepSeek and Grok don't publish a browser tokenizer, so those are estimates calibrated against o200k — exact counts: Claude count_tokens API, Gemini countTokens.
🔒 Runs in your browser — your text is never uploaded or sent to any AI provider.
How to count tokens
- Paste your text into the box, or drop a .txt, .md, .json or code file on it.
- Read the headline GPT token count (o200k_base) and the per-tokenizer cards. Badges tell you which counts are exact and which are estimates.
- Scroll the model table to see tokens, % of each context window and the input cost of this exact text. Tick “Show all models” for the full list.
What is a token?
Language models don't read characters or words — they read tokens, chunks produced by a byte-pair-encoding (BPE) tokenizer. Common English words are usually one token (" the", " hello"), rarer words split into pieces, and every space, digit group and punctuation mark counts. Rules of thumb for English prose with OpenAI's o200k tokenizer:
- 1 token ≈ 4 characters ≈ ¾ of a word
- 100 tokens ≈ 75 words; 1,000 tokens ≈ 1½ pages
- Code, JSON, numbers, emoji and non-Latin scripts use noticeably more tokens per character
Why counts differ between models
Each provider trains its own tokenizer, so the same text gives different counts:
| Tokenizer | Used by | This tool |
|---|---|---|
| o200k_base | GPT-6, GPT-5.x, GPT-4.1, GPT-4o, o3, o4-mini, gpt-oss | Exact (tiktoken) |
| cl100k_base | GPT-4, GPT-3.5 Turbo, text-embedding-3 | Exact (tiktoken) |
| Claude (new) | Claude Fable, Opus 4.7+, Sonnet 5+, Haiku 5.5 | Estimate ≈ 1.5× o200k |
| Claude (previous) | Sonnet 4.6, Haiku 4.5 and older | Estimate ≈ 1.15× o200k |
| Gemini | Gemini 4, 3.x, 2.5 | Estimate ≈ 4 characters / token |
Anthropic says its newer tokenizer (Claude 4.7 and later) produces about 30% more tokens for the same text than the previous one, and Google documents roughly 4 characters per Gemini token. Our estimates use those ratios; for billing-grade numbers, use each provider's count-tokens endpoint.
Tokens are what you pay for
API bills are per million tokens, separately for input (your prompt, chat history, documents) and output (the reply, including hidden reasoning tokens on thinking models). Output is usually 3–8× pricier per token. Once you have the token count, the LLM pricing calculator turns it into a monthly bill for every model.
Related tools
Frequently asked questions
Is my text sent to OpenAI, Anthropic or anyone else?
No. Everything runs in your browser: the tokenizer files are downloaded once and your text never leaves your device. Nothing is logged or stored.
How accurate is the token count?
OpenAI counts are exact: the tool runs tiktoken with the official o200k_base and cl100k_base files. Claude, Gemini, Llama, Mistral, DeepSeek and Grok don't publish browser tokenizers, so those numbers are estimates — typically within about 10% for English prose, less reliable for code or other languages.
How many tokens is 1,000 words?
About 1,300 tokens with OpenAI's o200k tokenizer for typical English, and roughly 1,950 with Claude's newer tokenizer. Paste your own text to see the real number — technical writing and code run higher.
Does the count include the chat-format overhead?
Not by default. Each chat message adds a few framing tokens (about 3–4 per message plus 3 to prime the reply on OpenAI). Tools, images and system instructions added by the provider also count; the API's usage field is the final word.
Can I count tokens for a whole file?
Yes — drop a text, Markdown, JSON or code file onto the box. Files up to 25 MB load; very large texts take a second to tokenize.
Your business here? Sponsor this tool from $16/week. See placements