Token Calculator for LLMs

Free AI token counter for GPT-5 class models, Claude Opus, Gemini, and other LLMs—estimate context length and API usage before you ship.

Token Calculator
Tokens (o200k)
0
Words
0
Characters (no spaces)
0
Total characters
0

How to Use

Paste your text

Paste or type prompts, system messages, or API payloads into the text area. Everything runs locally in your browser—nothing is uploaded.

View token count

Token counts use the same family of byte-pair encodings as modern OpenAI chat models (o200k_base), giving a strong estimate for English and mixed text.

Compare API costs

Multiply tokens by your provider’s per-1K rates for GPT-5.x, Claude Opus, Gemini, or other LLMs. Check each vendor’s pricing page for the latest numbers.

Optimize your prompts

Watch words and tokens together. Shorter system prompts, fewer examples, and tighter instructions usually reduce cost and latency.

Understanding tokenization

Large language models do not read characters the way humans do. Instead, a tokenizer splits text into tokens—short fragments that map to integers the neural network can process. The same sentence can produce different token counts on different families of models because each vendor may use its own vocabulary and merge rules.

For OpenAI-style chat models, BPE encodings such as cl100k and o200k are widely used. WiseCrew’s calculator uses o200k_base, which tracks closely with GPT-4o-era tokenization for everyday English and code. That makes it a practical universal tokenizer estimate when you are designing prompts or comparing rough costs across providers—always confirm with the exact model you bill against when precision is critical.

A rough rule of thumb is that one token is about 4 characters or ¾ of a word in English, but short words, numbers, and emojis can deviate. For high-stakes budgeting, combine this tool with your API dashboard.

Word-to-Token Conversion Guide

Token counts vary significantly based on content type and language. Use this reference to estimate token usage before running your text through the calculator.

Content TypeExampleRatio1000 Words ≈Notes
English TextHello world~1.3 tokens/word~1,300–1,500Standard prose averages ~1.3 tokens per word.
Code (Python/JS)def func():~2–3 tokens/word~2,000–3,000Symbols, operators, and syntax increase token count.
Chinese/Japanese你好世界~2+ tokens/char~2,000+CJK characters often split into multiple tokens.
Technical WritingAPI endpoint~1.5 tokens/word~1,500–1,800Technical terms and abbreviations vary.
JSON/XML Data{"key":"value"}~3–4 tokens/word~3,000–4,000Structural characters add significant overhead.

Compare Token Costs

Compare API pricing across major LLM providers. Prices shown are per 1 million tokens. The calculated prices below reflect the cost for your current input text.

ModelProviderContextInput/1M TokensInput(Cached)/1M TokensOutput/1M TokensInput PriceInput(cached) PriceOutput Price
GPT-5.4OpenAI1M$2.50$0.25$15.00$0.00$0.00$0.00
GPT-5 miniOpenAI400K$0.25$0.03$2.00$0.00$0.00$0.00
Claude Opus 4.6Anthropic200K$5.00$0.50$25.00$0.00$0.00$0.00
Claude Opus 4.5Anthropic200K$5.00$0.50$25.00$0.00$0.00$0.00
Claude Sonnet 4.6Anthropic200K$3.00$0.30$15.00$0.00$0.00$0.00
Claude Sonnet 4.5Anthropic200K$3.00$0.30$15.00$0.00$0.00$0.00
Claude Sonnet 4Anthropic200K$3.00$0.30$15.00$0.00$0.00$0.00
Claude Haiku 4.5Anthropic200K$1.00$0.10$5.00$0.00$0.00$0.00
Claude Haiku 3.5Anthropic200K$0.80$0.08$4.00$0.00$0.00$0.00
Gemini 3 Pro (Preview)Google1M$2.00$0.20$12.00$0.00$0.00$0.00
Gemini 3 Flash (Preview)Google1M$0.50$0.05$3.00$0.00$0.00$0.00
Gemini 2.5 ProGoogle2M$1.25$0.13$10.00$0.00$0.00$0.00
Gemini 2.5 FlashGoogle1M$0.30$0.03$2.50$0.00$0.00$0.00
Gemini 2.5 Flash-LiteGoogle1M$0.10$0.01$0.40$0.00$0.00$0.00
Gemini 2.0 FlashGoogle1M$0.10$0.03$0.40$0.00$0.00$0.00
Gemini 2.0 Flash-LiteGoogle1M$0.08$0.00$0.30$0.00$0.00$0.00

Pricing changes frequently. Treat this as a quick estimator and verify current rates in your provider dashboard. “Cached input” applies only if your provider supports prompt caching.

FAQ

Have more questions? Contact us