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

Text
Counted in your browser. Nothing is sent anywhere.

Kind of text, for the providers whose counts are estimates

Images and PDF pages
px
px
images
pages

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
ModelText tokensHow countedImages and PDFInput price per 1MAll of it as input
GPT-6 Sol430Calculated Exact · o200k_base—$2.00$0.0009
GPT-6 Astra430Calculated Exact · o200k_base—$10.00$0.0043
GPT-5.5430Calculated Exact · o200k_base—$5.00$0.0022
GPT-5.4 Mini430Calculated Exact · o200k_base—$0.750$0.0003
GPT-4.1430Calculated Exact · o200k_base—$2.00$0.0009
GPT-4o430Calculated Exact · o200k_base—$2.50$0.0011
GPT-4438Calculated Exact · cl100k_base—$30.00$0.013
Claude Opus 5.5639Calculated ≈ 1.486 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026—$4.00$0.0026
Claude Sonnet 5.5639Calculated ≈ 1.486 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026—$2.00$0.0013
Claude Haiku 5.5639Calculated ≈ 1.486 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026—$0.100$0.000064
Gemini 4 Argon433Calculated ≈ 1.007 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026—$2.00$0.0009
Gemini 3.8 Flash433Calculated ≈ 1.007 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026—$0.750$0.0003
DeepSeek V4 Pro 0813437Calculated ≈ 1.016 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026—$1.32$0.0006
Qwen3.8 Max (0902)441Calculated ≈ 1.026 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026—$2.00$0.0009
Grok 4.7436Calculated ≈ 1.014 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026—$2.00$0.0009
Kimi K3432Calculated ≈ 1.005 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026—$3.00$0.0013
GLM 5.3438Calculated ≈ 1.019 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026—$1.40$0.0006
Mistral Large 4449Calculated ≈ 1.044 × o200k_base · estimate; ratio measured on our 5 reference texts, 23 Oct 2026—$0.700$0.0003
MiniMax M3430Calculated ≈ 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 tokenEnglish proseSource codeJSONGerman, French and SpanishChinese and JapaneseMeasured
Reference text, o200k_base tokens430557535320306
Claude Opus 5.51.4861.5671.2821.8061.301
Claude Sonnet 5.51.4861.5671.2821.8061.301
Claude Haiku 5.51.4861.5671.2821.8061.301
Gemini 4 Argon1.0071.2191.2240.9940.755
Gemini 3.8 Flash1.0071.2231.2261.0030.794
DeepSeek V4 Pro 08131.0161.0771.0211.1690.830
Qwen3.8 Max (0902)1.0261.0741.1921.0120.732
Grok 4.71.0141.1451.0651.0190.810
Kimi K31.0051.0141.0081.3560.889
GLM 5.31.0190.9951.0091.1000.856
Mistral Large 41.0441.0181.0060.9841.033
MiniMax M31.0001.0221.0041.0220.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.

Model1024 × 1024 image1920 × 1080 imageDetail levelOne PDF page
GPT-6 Sol————
GPT-6 Astra1,2292,448auto (sized as original)—
GPT-5.51,2292,448auto (sized as original)—
GPT-5.4 Mini1,2292,448auto (sized as high)—
GPT-4.17651,105auto (tiles)—
GPT-4o7651,105auto (tiles)—
Claude Opus 5.51,3692,691high-resolution tier1,500–3,000 text, plus the page image
Claude Sonnet 5.51,3692,691high-resolution tier1,500–3,000 text, plus the page image
Claude Haiku 5.51,3692,691high-resolution tier1,500–3,000 text, plus the page image
Gemini 4 Argon≈ 1,120≈ 1,120media resolution not set (default)≈ 560
Gemini 3.8 Flash≈ 1,120≈ 1,120media 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
ProviderRuleSource
OpenAIoriginal 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
OpenAIoriginal 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
OpenAIhigh allows up to 2,500 patches and a 2048-pixel maximum dimension. ... auto uses the same sizing behavior as high.developers.openai.com
OpenAIScale 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
AnthropicAn 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
GoogleThe tables below summarize the approximate token counts for each media_resolution value ... Gemini 4 and Gemini 3 models: unspecified (Default) Image 1120ai.google.dev
GoogleGemini 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
AnthropicText 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
OpenAIOn 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

WhatHow
Text onlyCounts are for the text itself. A chat request adds a few tokens per message, and tools, system prompts and files add their own.
Estimated rowso200k_base count × the measured ratio for the kind of text you pick, rounded to a whole token. Mixed text falls between the kinds.
Special stringsText such as “<|endoftext|>” is counted as ordinary text.
ImagesThe 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.
CostAll 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 .