Free AI Token Calculator — Count Tokens & Estimate API Costs

Count tokens for GPT-5, GPT-4o, Claude, Gemini, Llama, DeepSeek and 70+ models. All calculations run locally in your browser — your text never leaves your computer.

100% Free No Upload 70+ Models Instant Results

AI Token Calculator

Your text

0 characters

Model & pricing

OpenAI models use the real tiktoken tokenizer; every other provider uses a calibrated estimate.

USD per 1M input tokens
USD per 1M output tokens

Token count · o200k_base

Tokens

—

Characters

0

Words

0

Lines

0

Bytes (UTF-8)

0

Tokens per char

—

Input cost

—

Output cost

—

Total

—

Free to embed on your own site — get the code. Data: model pricing JSON.
List prices per 1M tokens, last verified 2026-09-30 — edit them for your own contract.

Why developers use tokenestimate

ΣExact tiktoken counts

Uses the same Byte-Pair Encoding tokenizer as OpenAI's servers for accurate results.

$Cost before you code

Estimate API costs before making requests. Supports custom pricing for any model.

#100% local & private

All calculations run in your browser. No data uploaded, no tracking, no accounts needed.

⎈Built for AI workflows

Designed for developers, researchers, and AI engineers who need quick token estimates.

Supported models & pricing

Count tokens and estimate costs for 70+ models across every major AI provider. Prices are USD per 1M tokens, last verified 2026-09-30.

ModelCountingContextInput $ / 1MOutput $ / 1M
OpenAI
GPT-5.5exact tiktoken1M$5$30
GPT-5exact tiktoken400K$1.25$10
GPT-5 miniexact tiktoken400K$0.25$2
GPT-5 nanoexact tiktoken400K$0.05$0.4
GPT-4oexact tiktoken128K$2.5$10
GPT-4o miniexact tiktoken128K$0.15$0.6
GPT-4.1exact tiktoken1M$2$8
GPT-4.1 miniexact tiktoken1M$0.4$1.6
GPT-4.1 nanoexact tiktoken1M$0.1$0.4
o3 reasoningexact tiktoken200K$2$8
o4-mini reasoningexact tiktoken200K$1.1$4.4
o3-mini reasoningexact tiktoken200K$1.1$4.4
o1 reasoningexact tiktoken200K$15$60
OpenAI (legacy)
GPT-4 Turboexact tiktoken128K$10$30
GPT-4exact tiktoken8K$30$60
GPT-3.5 Turboexact tiktoken16K$0.5$1.5
OpenAI embedding
text-embedding-3-smallexact tiktoken–$0.02–
text-embedding-3-largeexact tiktoken–$0.13–
Anthropic Claude
Claude Opus 5.5 flagship, from 2026-09-22estimate1M$4$20
Claude Opus 5estimate200K$5$25
Claude Sonnet 5 intro pricingestimate200K$2$10
Claude Haiku 4.5estimate200K$1$5
Claude Fable 5 agenticestimate1M$10$50
Claude Opus 4.6estimate200K$5$25
Claude Sonnet 4.6estimate200K$3$15
Google Gemini
Gemini 3.1 Pro ≤200K ctxestimate2M$2$12
Gemini 3.6 Flashestimate1M$1.5$7.5
Gemini 3.5 Flashestimate1M$1.5$9
Gemini 3 Flashestimate1M$0.5$3
Gemini 3.5 Flash-Liteestimate1M$0.3$2.5
Gemini 2.5 Proestimate2M$1.25$10
Gemini 2.5 Flashestimate1M$0.3$2.5
Gemini 2.5 Flash-Liteestimate1M$0.1$0.4
US & EU
Grok 4.1 (xAI)estimate1M$0.2$1
Llama 4 (Meta) open-weightestimate1M$0.15$0.45
Mistral Large 3estimate128K$2$6
Amazon Nova Proestimate300K$0.8$3.2
DeepSeek (深度求索)
DeepSeek V4 Pro deepseek-chatestimate128K$0.44$0.87
DeepSeek V4 Flashestimate400K$0.14$0.28
DeepSeek V3.2estimate128K$0.35$0.42
DeepSeek R1 reasoningestimate64K$0.56$2.5
Alibaba Qwen (阿里通义)
Qwen3 Max (通义千问)estimate262K$0.78$3.9
Qwen3 Plusestimate128K$0.4$1.2
Qwen3 Flashestimate128K$0.15$1.5
Qwen3 Coder codingestimate128K$0.3$0.9
Zhipu GLM (智谱)
GLM-5 (智谱)estimate200K$1$3.2
GLM-5.1estimate200K$0.98$3.08
GLM-4.7estimate200K$0.5$2.2
GLM-4-Flash freeestimate128KFreeFree
Moonshot Kimi (月之暗面)
Kimi K2.6 (月之暗面) tieredestimate256K$1$2.5
Kimi K2.5estimate128K$0.6$3
Kimi K3 premiumestimate256K$7$14
ByteDance Doubao (火山引擎)
Doubao 1.6 Pro (豆包)estimate256K$0.11$0.45
Doubao 1.6 Flash cheapestestimate128K$0.01$0.11
Doubao 1.6 Liteestimate128K$0.02$0.04
Baidu ERNIE (百度)
ERNIE 4.5 (文心一言)estimate128K$0.2$0.55
ERNIE X1 reasoning · ultra cheapestimate128K$0.006$0.02
Tencent Hunyuan (腾讯)
Hunyuan 2 Pro (混元)estimate128K$1$4
Hunyuan Lite freeestimate32KFreeFree
iFlytek Spark (讯飞星火)
Spark Max / X1 (讯飞星火)estimate128K$0.5$1.7
Spark Lite freeestimate32KFreeFree
MiniMax (稀宇科技)
MiniMax M2.5 agentestimate197K$0.29$1.18
01.AI (零一万物)
Yi-Lightning (零一万物)estimate128K$0.4$1.2
StepFun (阶跃星辰)
Step-3 (阶跃星辰)estimate128K$0.5$1.5
SenseTime (商汤)
SenseNova 5.1 (商汤)estimate128K$0.04$0.7
Baichuan (百川智能)
Baichuan 4 (百川)estimate128K$1.2$2.8
Kunlun (昆仑万维)
SkyClaw 1.0 (昆仑万维) agentestimate1M$0.5$1.5
Xiaomi MiMo (小米)
MiMo V2.5 Pro (小米)estimate1M$0.44$0.87
MiMo V2.5estimate1M$0.14$0.28
Huawei PanGu (华为云)
PanGu 4.7 (盘古)estimate128K$0.5$1.5

Dedicated calculators

Developer guides

1.3How many tokens is a word?

Token-to-word ratios for GPT-5, GPT-4o, Claude, Gemini and Llama, with the character ratios behind them.

Read the guide →

$AI API pricing in 2026

Side-by-side list prices for every major model, plus how to cut input cost with caching and shorter prompts.

Read the guide →

Frequently asked questions

What is an AI token?

A token is the basic unit of text that language models read and generate. For English text, one word is roughly 1.3 tokens (about 4 characters per token). OpenAI bills all API usage in tokens, so understanding token counts helps you estimate costs.

How many tokens is a word?

On average, one English word equals approximately 1.3 tokens with OpenAI's o200k tokenizer. For Chinese text, one character equals about 0.6-1.2 tokens. The exact ratio depends on the model's tokenizer and the text content.

How accurate is this token calculator?

For OpenAI models, the calculator is exact — it uses the actual tiktoken tokenizer (same as OpenAI's servers). For Claude, Gemini, Llama, and other providers, it uses estimate mode (approximately 4 characters per token), accurate within 5-10%.

How much does GPT-4o cost per 1M tokens?

GPT-4o costs $2.50 per 1M input tokens and $10 per 1M output tokens. GPT-4o mini is much cheaper at $0.15 per 1M input and $0.60 per 1M output. All prices are editable in the calculator.

Which models are supported?

We cover 70 models plus a custom-pricing slot: OpenAI GPT-5.5 down to GPT-5 nano, GPT-4o, GPT-4.1, o1/o3/o4 and the embedding models (all exact tiktoken); Anthropic Claude Opus 5.5, Opus 5, Sonnet 5 and Haiku 4.5; Google Gemini 3.1 Pro through Flash-Lite; Meta Llama 4, xAI Grok, Mistral and Amazon Nova; plus DeepSeek, Qwen, GLM, Kimi, Doubao, ERNIE, Hunyuan, Spark, MiniMax, StepFun, SenseTime, Baichuan, Kunlun, MiMo and PanGu.

Is my text uploaded anywhere?

No. All calculations run 100% locally in your browser using JavaScript. Your prompts, code, and documents never leave your computer. You can even disconnect from the internet and the calculator will still work.

Can I use custom pricing?

Yes! You can edit the price per 1M tokens for any model. This is useful for enterprise pricing, custom fine-tunes, or when prices change. Your custom prices are saved in your browser for future sessions.

Why do token counts differ from word counts?

Tokens are not words. Common words like 'the' may be single tokens, while long words are split into multiple tokens. Whitespace is usually attached to the following token. The tokenizer uses Byte-Pair Encoding (BPE) to split text.

Start counting tokens for free

No signup required. Your text never leaves your browser.

Try the calculator

Building something with these numbers? Embed this calculator on your own site with one line of HTML, or take the 70-model pricing table as JSON under CC BY 4.0.