Tool
Token counter
How many tokens a text is for each provider’s models, and what it costs as input. The English sample below, 2,090 characters, is 430 tokens for GPT-6 Sol, 639 for Claude Sonnet 5.5, 433 for Gemini 4 Argon.
Calculated Runs in your browser. Your text stays on this device. OpenAI’s vocabulary files, about 1.5 MB, load from this site when you start typing. All calculators · Task cost calculator
Result Calculated sample text · data of 9 Nov 2026
- o200k_base tokens
- 430
- Characters
- 2,090
- Lowest input cost below
- $0.000064 · Claude Haiku 5.5
| Model | Text tokens | How counted | Images and PDF | Input price per 1M | All of it as input |
|---|---|---|---|---|---|
| GPT-6 Sol | 430 | Calculated Exact · o200k_base | — | $2.00 | $0.0009 |
| GPT-6 Astra | 430 | Calculated Exact · o200k_base | — | $10.00 | $0.0043 |
| GPT-5.5 | 430 | Calculated Exact · o200k_base | — | $5.00 | $0.0022 |
| GPT-5.4 Mini | 430 | Calculated Exact · o200k_base | — | $0.750 | $0.0003 |
| GPT-4.1 | 430 | Calculated Exact · o200k_base | — | $2.00 | $0.0009 |
| GPT-4o | 430 | Calculated Exact · o200k_base | — | $2.50 | $0.0011 |
| GPT-4 | 438 | Calculated Exact · cl100k_base | — | $30.00 | $0.013 |
| Claude Opus 5.5 | 639 | Calculated ≈ 1.486 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026 | — | $4.00 | $0.0026 |
| Claude Sonnet 5.5 | 639 | Calculated ≈ 1.486 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026 | — | $2.00 | $0.0013 |
| Claude Haiku 5.5 | 639 | Calculated ≈ 1.486 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026 | — | $0.100 | $0.000064 |
| Gemini 4 Argon | 433 | Calculated ≈ 1.007 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026 | — | $2.00 | $0.0009 |
| Gemini 3.8 Flash | 433 | Calculated ≈ 1.007 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026 | — | $0.750 | $0.0003 |
| DeepSeek V4 Pro 0813 | 437 | Calculated ≈ 1.016 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026 | — | $1.32 | $0.0006 |
| Qwen3.8 Max (0902) | 441 | Calculated ≈ 1.026 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026 | — | $2.00 | $0.0009 |
| Grok 4.7 | 436 | Calculated ≈ 1.014 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026 | — | $2.00 | $0.0009 |
| Kimi K3 | 432 | Calculated ≈ 1.005 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026 | — | $3.00 | $0.0013 |
| GLM 5.3 | 438 | Calculated ≈ 1.019 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026 | — | $1.40 | $0.0006 |
| Mistral Large 4 | 449 | Calculated ≈ 1.044 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026 | — | $0.700 | $0.0003 |
| MiniMax M3 | 430 | Calculated ≈ 1.000 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026 | — | $0.300 | $0.0001 |
Exact: OpenAI’s own vocabulary. ≈: an estimate — the o200k_base count × the ratio we measured on our five reference texts for this kind of text. Input prices as listed on ; a chat request adds a few tokens of message wrapping around your text.
How the counts are made
OpenAI: exact
Calculated OpenAI publishes its vocabularies as files: o200k_base and cl100k_base, read . They are the files OpenAI’s open-source tiktoken library downloads and checks before use, and this page splits text and merges byte pairs the same way, so the number is the library’s number. The library names the models for each vocabulary: o200k_base for o1, o3, o4-mini, gpt-5, gpt-4.5, gpt-4.1, chatgpt-4o and gpt-4o model names; cl100k_base for gpt-4, gpt-3.5-turbo and gpt-35-turbo model names. We also checked this page against OpenAI itself: on thirty-nine test texts — the reference texts and hard cases such as contractions, runs of spaces, long numbers, emoji and other scripts — OpenAI’s count for GPT-5.4 Mini was our o200k_base number plus the same 6 tokens of message wrapping every time (). For GPT-6 Sol and GPT-6 Astra the library has no entry, so we sent our five reference texts to OpenAI and compared: OpenAI counted exactly our o200k_base number plus the same message wrapping each time ().
Other providers: measured ratio
Observed Each provider counted our five reference texts itself — through Anthropic’s token counting endpoint, Google’s countTokens endpoint, or the input count in the provider’s own response — and we divided by the o200k_base count of the same text. For your text the page multiplies its o200k_base count by the ratio for the kind of text you pick, so these rows are estimates; the ratios differ most for code, data and languages other than English.
| Tokens per o200k_base token | English prose | Source code | JSON | German, French and Spanish | Chinese and Japanese | Measured |
|---|---|---|---|---|---|---|
| Reference text, o200k_base tokens | 430 | 557 | 535 | 320 | 306 | |
| Claude Opus 5.5 | 1.486 | 1.567 | 1.282 | 1.806 | 1.301 | |
| Claude Sonnet 5.5 | 1.486 | 1.567 | 1.282 | 1.806 | 1.301 | |
| Claude Haiku 5.5 | 1.486 | 1.567 | 1.282 | 1.806 | 1.301 | |
| Gemini 4 Argon | 1.007 | 1.219 | 1.224 | 0.994 | 0.755 | |
| Gemini 3.8 Flash | 1.007 | 1.223 | 1.226 | 1.003 | 0.794 | |
| DeepSeek V4 Pro 0813 | 1.016 | 1.077 | 1.021 | 1.169 | 0.830 | |
| Qwen3.8 Max (0902) | 1.026 | 1.074 | 1.192 | 1.012 | 0.732 | |
| Grok 4.7 | 1.014 | 1.145 | 1.065 | 1.019 | 0.810 | |
| Kimi K3 | 1.005 | 1.014 | 1.008 | 1.356 | 0.889 | |
| GLM 5.3 | 1.019 | 0.995 | 1.009 | 1.100 | 0.856 | |
| Mistral Large 4 | 1.044 | 1.018 | 1.006 | 0.984 | 1.033 | |
| MiniMax M3 | 1.000 | 1.022 | 1.004 | 1.022 | 0.657 |
Each ratio: the provider’s count of the reference text, minus its count of a one-character message, plus one, divided by the o200k_base count. The reference texts are in reference-texts.json.
Images and PDF pages
Stated by the provider Each provider counts an image by its own published rule: OpenAI covers newer models with 32-pixel patches and older ones with 512-pixel tiles, Anthropic with 28-pixel patches after scaling down to its limits, and Google charges a set amount per image and per PDF page on Gemini 4 and Gemini 3. Rules read ; where a provider publishes no number, the cell is empty.
| Model | 1024 × 1024 image | 1920 × 1080 image | Detail level | One PDF page |
|---|---|---|---|---|
| GPT-6 Sol | — | — | — | — |
| GPT-6 Astra | 1,229 | 2,448 | auto (sized as original) | — |
| GPT-5.5 | 1,229 | 2,448 | auto (sized as original) | — |
| GPT-5.4 Mini | 1,229 | 2,448 | auto (sized as high) | — |
| GPT-4.1 | 765 | 1,105 | auto (tiles) | — |
| GPT-4o | 765 | 1,105 | auto (tiles) | — |
| Claude Opus 5.5 | 1,369 | 2,691 | high-resolution tier | 1,500–3,000 text, plus the page image |
| Claude Sonnet 5.5 | 1,369 | 2,691 | high-resolution tier | 1,500–3,000 text, plus the page image |
| Claude Haiku 5.5 | 1,369 | 2,691 | high-resolution tier | 1,500–3,000 text, plus the page image |
| Gemini 4 Argon | ≈ 1,120 | ≈ 1,120 | media resolution not set (default) | ≈ 560 |
| Gemini 3.8 Flash | ≈ 1,120 | ≈ 1,120 | media resolution not set (default) | ≈ 560 |
Google calls its figures approximate (≈). OpenAI and Anthropic send each PDF page as text plus an image of the page and do not publish the page image size, so a page has no fixed count there; Anthropic gives a typical range for the text.
The rules, in the providers’ words
| Provider | Rule | Source |
|---|---|---|
| OpenAI | original preserves the image's dimensions, except that images larger than 65,535 pixels on either side are scaled down to fit that limit. If the resulting image requires more than 30,000 patches, the API rejects the request ... auto uses the same sizing behavior as original. | developers.openai.com |
| OpenAI | original allows up to 10,000 patches and a 6000-pixel maximum dimension. Both limits apply. auto uses the same sizing behavior as original. | developers.openai.com |
| OpenAI | high allows up to 2,500 patches and a 2048-pixel maximum dimension. ... auto uses the same sizing behavior as high. | developers.openai.com |
| OpenAI | Scale down to fit in a 2048px x 2048px square ... If the shortest side exceeds 768px, scale it down to 768px and round down the other dimension. Count the 512px squares needed to cover the image. ... Add the model's base tokens to the tile tokens. (gpt-4o, gpt-4.1: base 85, tile 170) | developers.openai.com |
| Anthropic | An image, therefore, costs ⌈width / 28⌉ × ⌈height / 28⌉ visual tokens. ... High-resolution: Claude 4.7 and later models, 2576 px, 4784 [visual tokens] | platform.claude.com |
The tables below summarize the approximate token counts for each media_resolution value ... Gemini 4 and Gemini 3 models: unspecified (Default) Image 1120 | ai.google.dev | |
Gemini 4 and Gemini 3 models: unspecified (Default) PDF 560. ... You are not charged for tokens originating from the extracted native text in PDFs. | ai.google.dev | |
| Anthropic | Text token costs: Each page typically uses 1,500–3,000 tokens per page depending on content density. ... Image token costs: Because each page is converted into an image, the same image-based cost calculations are applied. | platform.claude.com |
| OpenAI | On models with vision capabilities, such as gpt-4o and later models, the API extracts both text and page images and sends both to the model. | developers.openai.com |
Assumptions
| What | How |
|---|---|
| Text only | Counts are for the text itself. A chat request adds a few tokens per message, and tools, system prompts and files add their own. |
| Estimated rows | o200k_base count × the measured ratio for the kind of text you pick, rounded to a whole token. Mixed text falls between the kinds. |
| Special strings | Text such as “<|endoftext|>” is counted as ordinary text. |
| Images | The provider’s default detail level; where the documentation does not say how a side is rounded when an image is scaled down, to the nearest pixel. |
| Cost | All tokens at the model’s standard input price per 1M; cache, batch and long-request prices are left out. |
The task cost calculator turns token counts into the cost of a whole task. The methodology explains how prices are read.
Prices as shown in the United States on .