Skip to workspace
TC

AI Tokenizer & Token Cost Calculator

Count tokens with the exact OpenAI BPE encodings, see where every token boundary falls, and price your prompt across 95 live models — all computed in your browser.

  • No cloud storageYour prompts never leave the browser
  • Client-side BPEExact o200k & cl100k token boundaries
  • No account requiredFree forever, no paywall, no ads
Raw Input Editor(9 lines)
Chars:0
Words:0
Size:0 B
UTF-8 · Word wrap
BPE Token Inspector
Total tokens0
Characters0
Words0
Estimated input cost$0.000000
0.0% of context window used
Context windowClaude Sonnet 5o200k ≈

0 / 1,000,000 tokens0.00%

1,000,000 tokens remaining before this model's limit.

Safe range

No Tokens Generated

Type or paste text in the raw editor to inspect individual BPE token boundaries, hex encodings, and byte weights in real-time.

Latency:0 ms
BPE Engine Active

Workload Budget Calculator

Model what this prompt actually costs to run at volume. Set your batch size and expected output length, then compare standard input pricing against cached input pricing across every model in the live catalog. Models without a cache tier are marked — rather than given a fabricated discount.

Multi-Model Cost & Cache Matrix
1,000 calls
Batch Scale Multiplier1,000 runs
Completion Output Simulator+0 tokens (0.5x)
Simulated generation costTotal: 0 tok
Filter:
ModelStandard InputCached PromptSingle RunBatch Total (1,000)
Claude Sonnet 5.5
Anthropic • Claude BPE
$2.000 / 1M
$0.100 / 1M-95%
$0.00000
$0.00
Claude Haiku 5.5TIERS
Anthropic • Claude BPE
$0.100 / 1M
$0.010 / 1M-90%
$0.00000
$0.00
Claude Opus 5
Anthropic • Claude BPE
$5.000 / 1M
$0.500 / 1M-90%
$0.00000
$0.00
Claude Sonnet 5ACTIVE
Anthropic • Claude BPE
$2.000 / 1M
$0.200 / 1M-90%
$0.00000
$0.00
GPT-6.1 Sol ProTIERS
OpenAI • o200k_base
$2.000 / 1M
$0.100 / 1M-95%
$0.00000
$0.00
GPT-6.1 SolTIERS
OpenAI • o200k_base
$2.000 / 1M
$0.100 / 1M-95%
$0.00000
$0.00
GPT-6 LunaTIERS
OpenAI • o200k_base
$0.100 / 1M
$0.010 / 1M-90%
$0.00000
$0.00
GPT-5.6 SolTIERS
OpenAI • o200k_base
$2.000 / 1M
$0.200 / 1M-90%
$0.00000
$0.00
GPT-5.6 TerraTIERS
OpenAI • o200k_base
$2.000 / 1M
$0.200 / 1M-90%
$0.00000
$0.00
GPT-5.6 LunaTIERS
OpenAI • o200k_base
$0.200 / 1M
$0.020 / 1M-90%
$0.00000
$0.00
Gemini 3.8 Flash
Google • Gemini
$0.750 / 1M
$0.075 / 1M-90%
$0.00000
$0.00
Gemini 3.7 Flash
Google • Gemini
$0.750 / 1M
$0.075 / 1M-90%
$0.00000
$0.00
Gemini 3.5 Flash Lite
Google • Gemini
$0.300 / 1M
$0.030 / 1M-90%
$0.00000
$0.00
Llama 4 Maverick
Meta • Llama
$0.188 / 1M
$0.050 / 1M-73%
$0.00000
$0.00
DeepSeek V4.1 Flash
DeepSeek • DeepSeek
$0.300 / 1M
$0.006 / 1M-98%
$0.00000
$0.00
DeepSeek V4 Pro 0813TIERS
DeepSeek • DeepSeek
$0.660 / 1M
$0.022 / 1M-97%
$0.00000
$0.00
DeepSeek V4 Flash 0731
DeepSeek • DeepSeek
$0.010 / 1M
$0.010 / 1M-0%
$0.00000
$0.00
Grok 4.6TIERS
xAI • Grok
$2.000 / 1M
$0.500 / 1M-75%
$0.00000
$0.00
Qwen3.8 Max (0902)
Alibaba • Qwen
$2.000 / 1M
$0.250 / 1M-88%
$0.00000
$0.00
Qwen3.7 FlashTIERS
Alibaba • Qwen
$0.030 / 1M
$0.006 / 1M-80%
$0.00000
$0.00
Mistral Large 4
Mistral • Mistral
$0.680 / 1M
$0.070 / 1M-90%
$0.00000
$0.00
GPT-4
OpenAI • cl100k_base
$30.000 / 1M
—
$0.00000
$0.00
GPT-3.5 Turbo
OpenAI • cl100k_base
$0.500 / 1M
—
$0.00000
$0.00
Claude Opus 5.5
Anthropic • Claude BPE
$4.000 / 1M
$0.200 / 1M-95%
$0.00000
$0.00
DeepSeek V4 Flash 0423
DeepSeek • DeepSeek
$0.010 / 1M
$0.010 / 1M-0%
$0.00000
$0.00
GPT-6 AstraTIERS
OpenAI • o200k_base
$10.000 / 1M
$1.000 / 1M-90%
$0.00000
$0.00
GPT-6 SolTIERS
OpenAI • o200k_base
$2.000 / 1M
$0.200 / 1M-90%
$0.00000
$0.00
Gemini 3 Flash Preview
Google • Gemini
$0.500 / 1M
$0.050 / 1M-90%
$0.00000
$0.00
DeepSeek V4 Pro 0423
DeepSeek • DeepSeek
$0.955 / 1M
$0.080 / 1M-92%
$0.00000
$0.00
Gemini 2.5 Flash Lite
Google • Gemini
$0.100 / 1M
$0.010 / 1M-90%
$0.00000
$0.00
GPT-6 Luna ProTIERS
OpenAI • o200k_base
$0.100 / 1M
$0.010 / 1M-90%
$0.00000
$0.00
Qwen3.8 27B
Alibaba • Qwen
$0.425 / 1M
$0.085 / 1M-80%
$0.00000
$0.00
Grok 4.7TIERS
xAI • Grok
$2.000 / 1M
$0.500 / 1M-75%
$0.00000
$0.00
gpt-oss-120b
OpenAI • o200k_base
$0.037 / 1M
—
$0.00000
$0.00
Qwen3.8 Flash
Alibaba • Qwen
$0.150 / 1M
$0.016 / 1M-89%
$0.00000
$0.00
Gemini 3.1 Flash Lite
Google • Gemini
$0.250 / 1M
$0.025 / 1M-90%
$0.00000
$0.00
Gemini 2.5 Flash
Google • Gemini
$0.300 / 1M
$0.030 / 1M-90%
$0.00000
$0.00
Gemma 4 31B
Google • Gemma
$0.090 / 1M
$0.050 / 1M-44%
$0.00000
$0.00
DeepSeek V3.2
DeepSeek • DeepSeek
$0.259 / 1M
$0.135 / 1M-48%
$0.00000
$0.00
Gemma 4 26B A4B
Google • Gemma
$0.090 / 1M
$0.050 / 1M-44%
$0.00000
$0.00
Claude Sonnet 4.6
Anthropic • Claude BPE
$3.000 / 1M
$0.300 / 1M-90%
$0.00000
$0.00
Claude Fable 5.1
Anthropic • Claude BPE
$10.000 / 1M
$0.250 / 1M-98%
$0.00000
$0.00
Claude Haiku 4.5
Anthropic • Claude BPE
$1.000 / 1M
$0.100 / 1M-90%
$0.00000
$0.00
gpt-oss-20b
OpenAI • o200k_base
$0.018 / 1M
$0.009 / 1M-50%
$0.00000
$0.00
Gemini 3.1 Pro PreviewTIERS
Google • Gemini
$2.000 / 1M
$0.200 / 1M-90%
$0.00000
$0.00
Nano Banana 2.1
Google • Gemini
$1.500 / 1M
—
$0.00000
$0.00
Qwen3.8 Max Prime
Alibaba • Qwen
$4.000 / 1M
$0.500 / 1M-88%
$0.00000
$0.00
GPT-6 Sol ProTIERS
OpenAI • o200k_base
$2.000 / 1M
$0.200 / 1M-90%
$0.00000
$0.00
GPT-6 Astra ProTIERS
OpenAI • o200k_base
$10.000 / 1M
$1.000 / 1M-90%
$0.00000
$0.00
GPT-5.6 Luna ProTIERS
OpenAI • o200k_base
$0.200 / 1M
$0.020 / 1M-90%
$0.00000
$0.00
GPT-5.6 Terra ProTIERS
OpenAI • o200k_base
$2.000 / 1M
$0.200 / 1M-90%
$0.00000
$0.00
GPT-5.6 Sol ProTIERS
OpenAI • o200k_base
$2.000 / 1M
$0.200 / 1M-90%
$0.00000
$0.00
GPT Chat Latest
OpenAI • o200k_base
$5.000 / 1M
$0.500 / 1M-90%
$0.00000
$0.00
GPT-5.5 ProTIERS
OpenAI • o200k_base
$30.000 / 1M
—
$0.00000
$0.00
Claude Fable 5
Anthropic • Claude BPE
$10.000 / 1M
$1.000 / 1M-90%
$0.00000
$0.00
Claude Opus 4.8
Anthropic • Claude BPE
$5.000 / 1M
$0.500 / 1M-90%
$0.00000
$0.00
Claude Opus 4.7
Anthropic • Claude BPE
$5.000 / 1M
$0.500 / 1M-90%
$0.00000
$0.00
Claude Opus 4.6
Anthropic • Claude BPE
$5.000 / 1M
$0.500 / 1M-90%
$0.00000
$0.00
Claude Opus 4.5
Anthropic • Claude BPE
$5.000 / 1M
$0.500 / 1M-90%
$0.00000
$0.00
Claude Sonnet 4.5TIERS
Anthropic • Claude BPE
$3.000 / 1M
$0.300 / 1M-90%
$0.00000
$0.00
Gemini 3.6 Flash
Google • Gemini
$0.750 / 1M
$0.075 / 1M-90%
$0.00000
$0.00
Nano Banana 2 Lite (Gemini 3.1 Flash Lite Image)
Google • Gemini
$0.250 / 1M
—
$0.00000
$0.00
Nano Banana 2 (Gemini 3.1 Flash Image)
Google • Gemini
$0.500 / 1M
—
$0.00000
$0.00
Nano Banana Pro (Gemini 3 Pro Image)
Google • Gemini
$2.000 / 1M
$0.200 / 1M-90%
$0.00000
$0.00
Gemini 3.5 Flash
Google • Gemini
$1.500 / 1M
$0.150 / 1M-90%
$0.00000
$0.00
Lyria 3 Pro Preview
Google • Other BPE
$0.000 / 1M
—
$0.00000
$0.00
DeepSeek V4 Flash Vision Exp
DeepSeek • DeepSeek
$0.216 / 1M
$0.007 / 1M-97%
$0.00000
$0.00
DeepSeek V3.2 Exp
DeepSeek • DeepSeek
$0.270 / 1M
—
$0.00000
$0.00
DeepSeek V3.1 Terminus
DeepSeek • DeepSeek
$0.270 / 1M
—
$0.00000
$0.00
DeepSeek V3.1
DeepSeek • DeepSeek
$0.250 / 1M
$0.130 / 1M-48%
$0.00000
$0.00
R1 0528
DeepSeek • DeepSeek
$0.500 / 1M
$0.350 / 1M-30%
$0.00000
$0.00
DeepSeek V3 0324
DeepSeek • DeepSeek
$0.290 / 1M
$0.110 / 1M-62%
$0.00000
$0.00
Llama Guard 4 12B
Meta • Other BPE
$0.180 / 1M
—
$0.00000
$0.00
Llama 4 Scout
Meta • Llama
$0.100 / 1M
—
$0.00000
$0.00
Llama 3.3 70B Instruct
Meta • Llama
$0.100 / 1M
—
$0.00000
$0.00
Llama 3.2 1B Instruct
Meta • Llama
$0.027 / 1M
—
$0.00000
$0.00
Llama 3.2 3B Instruct
Meta • Llama
$0.050 / 1M
—
$0.00000
$0.00
Llama 3.1 70B Instruct
Meta • Llama
$0.400 / 1M
—
$0.00000
$0.00
Mistral Medium 3.5
Mistral • Mistral
$1.500 / 1M
—
$0.00000
$0.00
Mistral Small 4
Mistral • Mistral
$0.150 / 1M
$0.015 / 1M-90%
$0.00000
$0.00
Devstral 2 2512
Mistral • Mistral
$0.400 / 1M
$0.040 / 1M-90%
$0.00000
$0.00
Ministral 3 14B 2512
Mistral • Mistral
$0.200 / 1M
$0.020 / 1M-90%
$0.00000
$0.00
Ministral 3 8B 2512
Mistral • Mistral
$0.150 / 1M
$0.015 / 1M-90%
$0.00000
$0.00
Ministral 3 3B 2512
Mistral • Mistral
$0.100 / 1M
$0.010 / 1M-90%
$0.00000
$0.00
Grok 4.5TIERS
xAI • Grok
$2.000 / 1M
$0.300 / 1M-85%
$0.00000
$0.00
Grok Build 0.1TIERS
xAI • Grok
$1.000 / 1M
$0.200 / 1M-80%
$0.00000
$0.00
Grok 4.3TIERS
xAI • Grok
$1.250 / 1M
$0.200 / 1M-84%
$0.00000
$0.00
Grok 4.20 Multi-AgentTIERS
xAI • Grok
$1.250 / 1M
$0.200 / 1M-84%
$0.00000
$0.00
Grok 4.20TIERS
xAI • Grok
$1.250 / 1M
$0.200 / 1M-84%
$0.00000
$0.00
Qwen3.8 Omni Flash
Alibaba • Qwen
$0.150 / 1M
$0.016 / 1M-89%
$0.00000
$0.00
Qwen3.8 2.4T A95B
Alibaba • Qwen
$2.000 / 1M
$0.250 / 1M-88%
$0.00000
$0.00
Qwen3.7 PlusTIERS
Alibaba • Qwen
$0.320 / 1M
$0.064 / 1M-80%
$0.00000
$0.00
Qwen3.7 Max
Alibaba • Qwen
$1.475 / 1M
$0.295 / 1M-80%
$0.00000
$0.00
Qwen3.5 Plus 2026-04-20TIERS
Alibaba • Qwen
$0.300 / 1M
—
$0.00000
$0.00
Qwen3.6 FlashTIERS
Alibaba • Qwen
$0.188 / 1M
—
$0.00000
$0.00

How Tokenization Actually Works

The vocabulary behind every token count you see above — and why the same sentence costs more on one model than another.

  • What is an AI Tokenizer?

    Large language models don't read words or characters directly; they process text as numeric IDs called tokens. A tokenizer is a deterministic algorithm that decomposes raw text into these tokens using a fixed dictionary. Tokens represent whole words, word fragments, punctuation, or individual bytes.

  • How are tokens counted?

    Token counting applies Byte Pair Encoding (BPE) merge rules against text. Starting from individual bytes, the algorithm iteratively merges the most frequent pairs in its vocabulary into composite tokens. Formatting, spaces, capitalization, and numbers directly alter merge boundaries.

  • How many words are in 1,000 tokens?

    For standard English prose, 1,000 tokens is approximately 750 words (~0.75 words per token, or ~1.33 tokens per word). For source code, JSON, and LaTeX, the ratio shifts closer to 0.5–0.6 words per token due to indentation, punctuation, and camelCase syntax.

  • How many tokens are in 1,000 words?

    In general English, 1,000 words yields approximately 1,300 to 1,400 tokens. Older vocabularies like cl100k_base trend higher (~1,350 tokens), while modern o200k_base compresses this by 5–15% thanks to its expanded 200,000-token dictionary.

  • What is the difference between o200k and cl100k?

    cl100k_base (100k vocab) was introduced with GPT-4 and remains the standard for vector embeddings (text-embedding-3). o200k_base (200k vocab) powers GPT-4o, o1, and GPT-6, compressing code by ~15% and non-Latin scripts (Devanagari, CJK) by up to 25–40%.

  • How does prompt caching reduce API costs?

    Prompt caching allows providers (Anthropic, OpenAI, DeepSeek, Google) to reuse pre-computed KV-cache states for identical prompt prefixes. Reusing stable context discounts input pricing by 75% to 95% (e.g. Claude Sonnet 5.5 drops from $2.00 to $0.10/1M on cache hits).

Frequently Asked Questions

How TokenCraft handles your text, your data, and your money.