AI Tokenizer & Token Counter
Use this free AI tokenizer and token counter to watch OpenAI, Claude, Gemini, Llama, and DeepSeek split English, code, or Hindi / Japanese / Arabic side by side—and compare the exact token cost across models.
How many tokens does text, code, or an image actually consume?
English prose averages ~4 characters (0.75 words) per token, while source code and JSON average ~3 characters per token.
Expand the details
Non-Latin scripts like Hindi, Japanese, and Arabic often trigger 2×–4× higher token counts under Western-centric BPE vocabularies, and vision inputs follow provider-specific tile or pixel formulas.
- English prose: ~3.8–4.0 chars/token (1,000 words ≈ 1,330 tokens across o200k_base & Claude).
- Code & JSON: ~3.0–3.2 chars/token due to brackets, whitespace indentation, and syntax symbols.
- Non-Latin scripts: Hindi, Japanese, and Arabic can cost 2×–4× more tokens per sentence depending on vocab size.
- Multimodal vision: 512×512 ≈ 85 tokens, 1024×1024 ≈ 255 tokens (OpenAI tile math), or (w×h)/750 on Claude.
Hover or tap a token to inspect its id, byte length, and character count.
Side-by-side token counts
Cost of Language / Code
Same text, two models. The delta isolates how much of the bill is tokenizer inefficiency vs sticker price.
Paste text to compute the cost delta.
Compress this text in the TrimmerMultimodal Input Cost Estimator
Upload an image or PDF to parse its exact dimensions, or model images, PDFs, audio, and video by hand. OpenAI tile math, Claude (w×h)/750, and Gemini fixed rates run side-by-side.
Drag & drop an image (PNG/JPG/WebP) or PDF here, or — dimensions are read locally, nothing is uploaded.
OpenAI: 85 + 170 × 512×512 tiles. Claude: (w×h)/750. Gemini: 258 fixed per image.
Cost across 5 reference models
All models (cheapest first)
24 modelsLegacy single-text tokenizer & character-ratio estimator
BPE vs. SentencePiece: Why Tokenizers Change Your API Bill
What is a Token Across Providers?
LLMs process language in subword chunks rather than whole words. Because OpenAI (`o200k_base`, `cl100k_base`), Anthropic Claude, Llama 3 / DeepSeek (128K BPE), and Gemini (SentencePiece) train different merge tables, identical text can differ by 10%–35% in billed tokens—especially in multilingual or structured JSON workloads.
- Check fit before sending long documents in the Context Window Visualizer.
- Convert per-token, per-1K, and per-1M rates in the Token Price Converter.
How to Compress Prompts Without Losing Accuracy
Eliminate conversational filler in system prompts, use terse bullet rules and compact JSON keys, and strip duplicate few-shot examples. Even a 25% token cut compounds across millions of monthly requests.
- Run automated filler removal with word diffs in the Prompt Token Trimmer.
- Model monthly savings across 20+ models in the AI Token Cost Calculator.
LLM Tokenizer & Multimodal Token FAQ
4 short answers — tap a question to expand.
How many words or characters are in one LLM token?
In English prose, 1 token averages 3.8 to 4.0 characters (~0.75 words, or ~100 tokens per 75 words). Code and structured JSON average ~3.0 to 3.2 characters per token because brackets, indentation, and punctuation split into extra tokens.
Why do Hindi, Japanese, and Arabic prompts cost 2x–4x more than English?
Subword BPE vocabularies trained mostly on English text split non-Latin scripts into far smaller byte or character chunks. That increases the exact token count—and your API invoice—for identical semantic meaning.
How do OpenAI o200k_base, Anthropic Claude, Llama 3, and Gemini tokenizers differ?
OpenAI o200k_base uses a 200K-token BPE vocabulary that packs English and code slightly tighter than legacy cl100k_base (100K), Llama 3/DeepSeek use 128K BPE vocabularies, and Gemini uses SentencePiece. Comparing side-by-side exposes hidden 10%–35% token count gaps.
How are images, PDFs, and audio billed as tokens?
OpenAI bills high-detail images by 512x512 tiles (e.g., ~255 tokens for 1024x1024), Anthropic Claude estimates image tokens via (width × height) / 750, and Gemini charges fixed per-image or per-second multimedia rates.