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
GPT-4oOpenAI128K$2.50$1.25$10.00$0.00$0.00$0.00
GPT-4o miniOpenAI128K$0.15$0.08$0.60$0.00$0.00$0.00
o3OpenAI200K$10.00$2.50$40.00$0.00$0.00$0.00
o4-miniOpenAI200K$1.10$0.28$4.40$0.00$0.00$0.00
Claude Opus 5Anthropic200K$5.00$0.50$25.00$0.00$0.00$0.00
Claude Sonnet 5Anthropic200K$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 FlashGoogle1M$0.50$0.13$3.00$0.00$0.00$0.00
Gemini 2.5 ProGoogle2M$1.25$0.31$10.00$0.00$0.00$0.00
Gemini 2.5 FlashGoogle1M$0.30$0.08$2.50$0.00$0.00$0.00
Gemini 2.5 Flash-LiteGoogle1M$0.10$0.03$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
Llama 4 MaverickMeta1M$0.27$0.00$0.85$0.00$0.00$0.00
Llama 4 ScoutMeta128K$0.18$0.00$0.59$0.00$0.00$0.00
Llama 3.3 70BMeta128K$0.23$0.00$0.40$0.00$0.00$0.00
Llama 3.1 405BMeta128K$1.00$0.00$3.00$0.00$0.00$0.00
Llama 3.1 8BMeta128K$0.05$0.00$0.08$0.00$0.00$0.00
DeepSeek V3DeepSeek64K$0.27$0.07$1.10$0.00$0.00$0.00
DeepSeek R1DeepSeek64K$0.55$0.14$2.19$0.00$0.00$0.00
Mistral Large 2Mistral AI128K$2.00$0.00$6.00$0.00$0.00$0.00
Mistral Small 3Mistral AI128K$0.10$0.00$0.30$0.00$0.00$0.00
Grok 3 minixAI131K$0.30$0.00$0.50$0.00$0.00$0.00
Command RCohere128K$0.15$0.00$0.60$0.00$0.00$0.00
Embed v3 EnglishCohere512K$0.10$0.00$0.00$0.00$0.00$0.00
Rerank v3Cohere4K$2.00$0.00$0.00$0.00$0.00$0.00
text-embedding-3-largeOpenAI8K$0.13$0.00$0.00$0.00$0.00$0.00
Gemma 3 12BGoogle128K$0.12$0.00$0.12$0.00$0.00$0.00
Ministral 8BMistral AI128K$0.10$0.00$0.10$0.00$0.00$0.00
Ministral 3BMistral AI128K$0.04$0.00$0.04$0.00$0.00$0.00
Mistral EmbedMistral AI8K$0.10$0.00$0.00$0.00$0.00$0.00
Qwen 3 72BAlibaba128K$0.90$0.00$0.90$0.00$0.00$0.00
Qwen 3 32BAlibaba128K$0.40$0.00$0.40$0.00$0.00$0.00
QwQ 32BAlibaba128K$0.90$0.00$0.90$0.00$0.00$0.00
Qwen 3 14BAlibaba128K$0.15$0.00$0.15$0.00$0.00$0.00
Llama 3.2 3BMeta128K$0.06$0.00$0.06$0.00$0.00$0.00
DeepSeek R1 Distill Llama 70BDeepSeek128K$0.88$0.00$0.88$0.00$0.00$0.00
o1OpenAI200K$15.00$7.50$60.00$0.00$0.00$0.00
o1-miniOpenAI128K$1.10$0.55$4.40$0.00$0.00$0.00
o3-miniOpenAI200K$1.10$0.55$4.40$0.00$0.00$0.00
text-embedding-3-smallOpenAI8K$0.02$0.00$0.00$0.00$0.00$0.00
Claude Opus 4Anthropic200K$15.00$1.50$75.00$0.00$0.00$0.00
Claude Sonnet 4Anthropic200K$3.00$0.30$15.00$0.00$0.00$0.00
Claude 3.5 HaikuAnthropic200K$0.80$0.08$4.00$0.00$0.00$0.00
Gemini 3 ProGoogle2M$2.50$0.63$15.00$0.00$0.00$0.00
Gemma 3 27BGoogle128K$0.27$0.00$0.27$0.00$0.00$0.00
Gemma 3 4BGoogle128K$0.04$0.00$0.04$0.00$0.00$0.00
Llama 3.1 70BMeta128K$0.68$0.00$0.88$0.00$0.00$0.00
Llama 3.2 11B VisionMeta128K$0.18$0.00$0.18$0.00$0.00$0.00
Llama 3.2 90B VisionMeta128K$0.90$0.00$0.90$0.00$0.00$0.00
Mistral Large 2411Mistral AI128K$2.00$0.00$6.00$0.00$0.00$0.00
Mixtral 8×22BMistral AI64K$1.20$0.00$1.20$0.00$0.00$0.00
Mixtral 8×7BMistral AI32K$0.24$0.00$0.24$0.00$0.00$0.00
CodestralMistral AI256K$0.30$0.00$0.90$0.00$0.00$0.00
DeepSeek R1 Distill Qwen 32BDeepSeek128K$0.50$0.00$0.50$0.00$0.00$0.00
DeepSeek V2.5DeepSeek64K$0.14$0.00$0.28$0.00$0.00$0.00
Grok 3xAI131K$3.00$0.00$15.00$0.00$0.00$0.00
Grok 2xAI131K$2.00$0.00$10.00$0.00$0.00$0.00
Command R+Cohere128K$2.50$0.00$10.00$0.00$0.00$0.00
Embed English v3Cohere4K$0.10$0.00$0.00$0.00$0.00$0.00
Qwen 3 7BAlibaba128K$0.06$0.00$0.06$0.00$0.00$0.00
Qwen 2.5 72BAlibaba128K$0.60$0.00$0.60$0.00$0.00$0.00
Amazon Nova ProAmazon300K$0.80$0.00$3.20$0.00$0.00$0.00
Amazon Nova LiteAmazon300K$0.06$0.00$0.24$0.00$0.00$0.00
Amazon Nova MicroAmazon128K$0.04$0.00$0.14$0.00$0.00$0.00
Jamba 1.5 LargeAI21 Labs256K$2.00$0.00$8.00$0.00$0.00$0.00
Jamba 1.5 MiniAI21 Labs256K$0.20$0.00$0.40$0.00$0.00$0.00
Sonar ProPerplexity200K$3.00$0.00$15.00$0.00$0.00$0.00
SonarPerplexity128K$1.00$0.00$1.00$0.00$0.00$0.00
Palmyra X5Writer1M$6.00$0.00$24.00$0.00$0.00$0.00
Palmyra X4Writer128K$2.50$0.00$10.00$0.00$0.00$0.00
Snowflake ArcticSnowflake4K$0.01$0.00$0.02$0.00$0.00$0.00
Yi Large01.AI32K$3.00$0.00$3.00$0.00$0.00$0.00
FireFunction v2Fireworks AI8K$0.90$0.00$0.90$0.00$0.00$0.00
Inflection 3 PiInflection8K$2.50$0.00$10.00$0.00$0.00$0.00
Llama 3.3 70B (Groq)Groq128K$0.59$0.00$0.79$0.00$0.00$0.00
Llama 3.1 8B (Groq)Groq128K$0.05$0.00$0.08$0.00$0.00$0.00
Mixtral 8×7B (Groq)Groq32K$0.24$0.00$0.24$0.00$0.00$0.00
Gemma 3 27B (Groq)Groq128K$0.27$0.00$0.27$0.00$0.00$0.00
Qwen 2.5 Coder 32BAlibaba128K$0.20$0.00$0.20$0.00$0.00$0.00
DeepSeek R1 Distill Qwen 7BDeepSeek128K$0.15$0.00$0.15$0.00$0.00$0.00
Phi-4Microsoft16K$0.07$0.00$0.14$0.00$0.00$0.00
Phi-4 MiniMicrosoft16K$0.03$0.00$0.05$0.00$0.00$0.00
StableLM 2 12BStability AI4K$0.10$0.00$0.10$0.00$0.00$0.00
Sky-T1 32BNovaSky32K$1.20$0.00$1.20$0.00$0.00$0.00
GPT-4.5OpenAI128K$75.00$37.50$150.00$0.00$0.00$0.00
GPT-Image-1OpenAI128K$5.00$0.00$40.00$0.00$0.00$0.00
Gemini 1.5 ProGoogle2M$1.25$0.31$5.00$0.00$0.00$0.00
Gemini 1.5 FlashGoogle1M$0.08$0.02$0.30$0.00$0.00$0.00
Llama 3.1 70B TurboMeta128K$0.54$0.00$0.54$0.00$0.00$0.00
Mistral 7BMistral AI32K$0.10$0.00$0.10$0.00$0.00$0.00
Pixtral 12BMistral AI128K$0.15$0.00$0.15$0.00$0.00$0.00
Grok 3 Mini FastxAI131K$0.60$0.00$4.00$0.00$0.00$0.00
Llama 3.3 70B (Cerebras)Cerebras128K$0.60$0.00$0.60$0.00$0.00$0.00
Llama 3.1 8B (Cerebras)Cerebras128K$0.10$0.00$0.10$0.00$0.00$0.00

Last verified: 2026-08-20. Pricing changes frequently. Verify in your provider dashboard before budgeting. Data sources.

FAQ

Have more questions? Contact us