About this tool
Token Counter is a free online tool that counts how many tokens your text uses for OpenAI models like GPT-4o, o1, and o3. Token count is the primary billing metric for OpenAI API — every input and output token costs money. Knowing your token usage helps you control costs and stay within context limits.
How it works
1
Paste your text
Type or paste any text — a prompt, article, or full chat conversation. Everything runs in your browser.
2
See token count
The tool instantly shows the number of tokens, characters, and words. Token count is exact — same as OpenAI tiktoken.
3
Estimate cost
See estimated API cost based on current GPT-4o pricing. Choose input/output mix and context window to plan your budget.
Advertisement
Frequently Asked Questions
What is a token? v
A token is a piece of text — roughly 4 characters of English text, or 0.75 words. OpenAI models are billed per token, not per word or character.
Which models does this counter support? v
GPT-4o, GPT-4.1, o1, o3 — all use the o200k_base tokenizer. Older models (GPT-3.5, GPT-4) use cl100k_base — counts are close but not identical.
Are the counts exactly the same as OpenAI? v
Yes. The tool uses the official gpt-tokenizer library with o200k_base — the same tokenizer as OpenAI API. Results match tiktoken exactly.
Is my text sent to a server? v
No. Everything runs locally in your browser. Your text never leaves your device.
How is cost calculated? v
Based on GPT-4o pricing: $2.50 per 1M input tokens and $10.00 per 1M output tokens (as of 2026). Actual pricing may change — check OpenAI.