Free tool
Token counter for GPT, Claude, Gemini and Llama
Paste text or drop a file to count characters, words and tokens. Exact counts with OpenAI’s tokenizers, labelled estimates for Claude, Gemini and open models, and the input cost on every model we price.
Your text
Drop a .txt, .md, .json or .csv file here, up to 5 MB.
Runs in your browser. Nothing you type or upload leaves your device.
Tokens (o200k_base, GPT-5 and GPT-4o)
…
Loading the tokenizer…
- Characters
- 385
- Words
- 62
- cl100k_base (GPT-4, GPT-3.5)
- …
Other models
- Claude o200k × 1.35, current tokenizerEstimate…
- Gemini about the o200k countEstimate…
- Llama 3 about the cl100k countEstimate…
- Qwen cl100k, digits splitEstimate…
- DeepSeek o200k × 1.2Estimate…
- Mistral rough: the o200k countEstimate…
Estimates follow each provider’s published figures; the method for each is under “How the estimates work” below.
How the text splits into tokens
Loading the tokenizer…
First 400 tokens in o200k_base. Each colour is one token.
What this text costs as input
Input price × tokens, at prices verified on October 27, 2026. ≈ marks an estimated count.
| Model | Tokens | Input cost | Fits context |
|---|---|---|---|
| Claude Fable 5.1Anthropic | … | … | … |
| Claude Opus 5.5Anthropic | … | … | … |
| Claude Sonnet 5.5Anthropic | … | … | … |
| Claude Haiku 5.5Anthropic | … | … | … |
| Claude Opus 5Anthropic | … | … | … |
| Claude Sonnet 5Anthropic | … | … | … |
| Claude Sonnet 4.6Anthropic | … | … | … |
| Claude Haiku 4.5Anthropic | … | … | … |
| GPT-6 AstraOpenAI | … | … | … |
| GPT-6.1 SolOpenAI | … | … | … |
| GPT-6.1 TerraOpenAI | … | … | … |
| GPT-6 LunaOpenAI | … | … | … |
| GPT-5.5OpenAI | … | … | … |
| GPT-5.4 miniOpenAI | … | … | … |
| GPT-5 miniOpenAI | … | … | … |
| GPT-5 nanoOpenAI | … | … | … |
| Gemini 4 ArgonGoogle | … | … | … |
| Gemini 3.8 FlashGoogle | … | … | … |
| Gemini 3.5 Flash-LiteGoogle | … | … | … |
| Gemini 3.1 Flash-LiteGoogle | … | … | … |
| Gemini 3.1 Pro PreviewGoogle | … | … | … |
| Gemini 2.5 ProGoogle | … | … | … |
| Gemini 2.5 FlashGoogle | … | … | … |
| Gemini 2.5 Flash-LiteGoogle | … | … | … |
| Grok 4.7xAI | … | … | … |
| Grok 4.3xAI | … | … | … |
| Grok Build 0.1xAI | … | … | … |
| DeepSeek V4.1 FlashDeepSeek | … | … | … |
| DeepSeek V4 ProDeepSeek | … | … | … |
| Mistral Large 4Mistral | … | … | … |
| Mistral Medium 3.5Mistral | … | … | … |
| Mistral Large 3Mistral | … | … | … |
| Mistral Small 4Mistral | … | … | … |
Quick answer
How do you count tokens?
A token counter splits text the way a model’s tokenizer does and counts the pieces. OpenAI’s GPT-5, GPT-4.1, GPT-4o and o-series models use the o200k_base tokenizer, and OpenAI’s rule of thumb is 1 token ≈ 4 characters or 0.75 words of English. Example: “Tokens are pieces of words.” is 6 tokens: Tokens, are, pieces, of, words and the full stop.
How to use the token counter
- Add your text
Paste text into the box, or drop a .txt, .md, .json or .csv file of up to 5 MB. Characters and words update as you type.
- Read the exact counts
o200k_base is the tokenizer of GPT-5, GPT-4.1, GPT-4o and the o-series; cl100k_base is GPT-4 and GPT-3.5 Turbo.
- Compare other models
Claude, Gemini, Llama, Qwen, DeepSeek and Mistral get estimates, each labelled with how it is made.
- Check cost and fit
The cost panel prices the text as input on every model and shows whether it fits the context window.
How the counts are made
The OpenAI counts are exact: the page runs the open-source gpt-tokenizer library, a JavaScript port of OpenAI’s tiktoken encodings, in your browser. Special-token strings such as <|endoftext|> are counted as ordinary text, the way they are in a normal prompt. Long texts are counted in chunks split at line breaks, which gives the same total as counting in one go without freezing the page.
No exact tokenizer for current Claude, Gemini or Grok models runs in a browser, so those counts are estimates anchored on the exact count and scaled by each provider’s own published figures. Llama and Qwen built their vocabularies on top of cl100k_base, so their estimates start from that count. For exact Claude or Gemini numbers, use the token counting endpoint in Anthropic’s or Google’s API with the model ID.
Characters are Unicode characters, so an emoji counts once. Words are runs of characters between spaces or line breaks. Message formatting in a chat request (roles, tool definitions) adds tokens this text count does not include.
Exact: tokens = length of encode(text) with o200k_base or cl100k_base
Claude ≈ o200k × 0.75 ÷ 0.555 (≈ 1.35)
Gemini ≈ o200k × 4 ÷ 4
DeepSeek ≈ o200k × 4 × 0.3 (= 1.2)
Llama 3 ≈ cl100k
Qwen ≈ cl100k + extra tokens for split digits
Input cost = tokens × input price per 1M ÷ 1,000,000Worked example
- The sample text in the box: 385 characters and 62 words.
- o200k_base: 77 tokens, so 385 ÷ 77 = 5.0 characters per token and 62 ÷ 77 × 100 ≈ 81 words per 100 tokens.
- cl100k_base: also 77 tokens for this text.
- Claude estimate: 77 × 0.75 ÷ 0.555 = 104 tokens.
- Input cost on GPT-5.5 at $5 per 1M tokens: 77 × $5 ÷ 1,000,000 = $0.000385.
Tokens to words, and words to tokens
There is no single conversion: it depends on the tokenizer and the text. These are the providers’ own rules of thumb for English, averaged over many texts, so count the real text when it matters.
| Tokenizer | 1 token is about | 1,000 English words | Source |
|---|---|---|---|
| OpenAI (o200k_base, cl100k_base) | 4 characters or 0.75 words | ≈ 1,333 tokens | OpenAI docs |
| Claude, current (Opus 4.7 and later) | 0.555 words (1M tokens ≈ 555,000 words) | ≈ 1,802 tokens | Anthropic docs |
| Claude, previous (Sonnet 4.6, Haiku 4.5) | 0.75 words (1M tokens ≈ 750,000 words) | ≈ 1,333 tokens | Anthropic docs |
| Gemini | 4 characters (100 tokens ≈ 60–80 words) | ≈ 1,250–1,667 tokens | Google docs |
| Llama 3 | 3.94 characters | Not stated | Meta, Llama 3 paper |
| Qwen | 3–4 characters (Chinese: 1.5–1.8) | Not stated | Qwen docs |
| DeepSeek | 3.3 characters (0.3 tokens per character; Chinese 0.6) | Not stated | DeepSeek docs |
Which models use o200k_base and cl100k_base
OpenAI’s tiktoken library maps every model to its encoding. o200k_base has a vocabulary of about 200,000 tokens and cl100k_base about 100,000. OpenAI has not published the tokenizer of its GPT-6 models, so for GPT-6 the o200k_base count is shown as an estimate.
| Encoding | Models |
|---|---|
| o200k_base | GPT-5 family (GPT-5, 5.1, 5.2, 5.4, 5.5, 5.6 and their mini, nano and pro versions), GPT-4.5, GPT-4.1, GPT-4o, o1, o3, o4-mini |
| cl100k_base | GPT-4, GPT-4 Turbo, GPT-3.5 Turbo, text-embedding-3-small, text-embedding-3-large, text-embedding-ada-002 |
How the estimates work
| Model family | Estimate | Based on |
|---|---|---|
| Claude (Opus 4.7 and later, all Claude 5) | o200k × 1.35 | OpenAI: 0.75 words per token. Anthropic: 555,000 words per 1M tokens on the current tokenizer, about 30% more tokens than before. 0.75 ÷ 0.555 ≈ 1.35. |
| Claude (Sonnet 4.6, Haiku 4.5) | o200k × 1 | Anthropic: about 750,000 words per 1M tokens, the same as OpenAI’s 0.75 words per token. |
| Gemini | o200k × 1 | Google and OpenAI both put a token at about 4 characters of English. |
| DeepSeek | o200k × 1.2 | DeepSeek: 1 English character ≈ 0.3 tokens, against OpenAI’s 4 characters per token. |
| Llama 3 | cl100k | Meta built Llama 3’s vocabulary from 100,000 tiktoken tokens plus 28,000 for other languages, with no impact on English. |
| Qwen | cl100k + split digits | Qwen started from cl100k_base and gives every digit its own token; Qwen3 uses the same tokenizer. Chinese text needs fewer tokens than this. |
| Mistral, Grok, GPT-6 | o200k × 1 | No tokenizer or ratio published. A rough stand-in only. |
Token counter questions
- How many tokens is 1,000 words?
- About 1,333 tokens on OpenAI’s tokenizers by OpenAI’s rule of thumb (0.75 words per token), about 1,800 on Claude’s current tokenizer, and 1,250 to 1,667 on Gemini by Google’s figures. Paste your text for an exact OpenAI count.
- What is the OpenAI tokenizer?
- It is the byte-pair encoding that splits text into tokens for OpenAI’s models. GPT-5, GPT-4.1, GPT-4o and the o-series use o200k_base; GPT-4 and GPT-3.5 Turbo use cl100k_base. This page runs both in your browser.
- How do I count tokens for Claude?
- Anthropic has no browser tokenizer for current Claude models, so this page estimates from its published figures: about 1.35 times the o200k count. For an exact count, use the token counting endpoint of Anthropic’s API with the model ID.
- How many characters is a token?
- In English, about 4 by OpenAI’s and Google’s rules of thumb, and about 2.5 on Claude’s current tokenizer by Anthropic’s figure. The counter shows the exact characters per token of your own text.
- Do spaces and line breaks count as tokens?
- Yes. Whitespace is part of the text and is tokenized like everything else, usually merged into the next word or into runs of spaces. Minifying JSON or removing indentation lowers the count.
- Why are the Claude and Gemini counts estimates?
- No exact tokenizer for current Claude or Gemini models runs in a browser, so the page scales the exact OpenAI count by each provider’s published figures. Their APIs’ token counting endpoints give exact numbers.
- How much does it cost to send this text to a model?
- Multiply the tokens by the model’s input price per million and divide by 1,000,000: 10,000 tokens on GPT-6.1 Sol at $2 per 1M cost $0.02. The cost panel does this for every model we price.
- Is my text uploaded anywhere?
- No. The text and any file you drop are read and tokenized in your browser. Nothing is sent to SaaSCity or any other server.
- What is the largest file I can check?
- Files up to 5 MB in .txt, .md, .json or .csv format. Larger files and other formats are turned away before they are read.
Cite this tool
Free to link and quote. Use this reference:
SaaSCity, "AI Token Counter", October 27, 2026. https://saascity.io/free-tools/token-counter
Sources
- OpenAI, Key concepts: tokens (rule of thumb)
- OpenAI, tiktoken model-to-encoding map
- gpt-tokenizer (MIT), the library this page runs
- Anthropic, Models overview (words and characters per 1M tokens)
- Anthropic, Pricing (current tokenizer, about 30% more tokens)
- Google, Understand and count tokens
- Meta, The Llama 3 Herd of Models (2024)
- Qwen Technical Report (2023)
- Qwen3 Technical Report (2025)
- Qwen docs, Key concepts
- DeepSeek, Token & token usage
- OpenAI, API pricing (prices)
- Google, Gemini Developer API pricing (prices)
- xAI, Grok API pricing (prices)
- DeepSeek, Models & Pricing (prices)
- Mistral, API pricing (prices)