Free AI tool · counts in your browser
Token counter and tokenizer for LLMs.
Paste a prompt and see its token count for the model you plan to use, how the text splits into tokens, whether it fits the context window with room for the reply, and what it costs. OpenAI counts are exact and run in your browser. Claude and Gemini counts are exact when they come from the provider, and every estimate is labelled as one.
Added to your text when checking the context window.
Loading the tokenizer…
Exact: counted in your browser with OpenAI's o200k_base encoding.
Privacy: OpenAI counts run in your browser. Text leaves it only when you press "Count exactly".
Prices checked on 18 October 2026. Public list prices in US dollars per 1M tokens, copied by script from models.dev (MIT, list prices, cached-input prices, context windows) and LiteLLM model price file (MIT, batch api prices and reranker prices). Nothing is typed by hand. Confirm a price on the provider's own page before you commit to it; providers change prices and add surcharges (long prompts, regions, priority tiers) that a summary table cannot show.
Rules applied, and where we read them
- OpenAI model-to-encoding map (tiktoken's model.py) (checked 2026-10-18)
- Anthropic count_tokens: free, rate-limited per usage tier (checked 2026-10-18)
- Gemini countTokens, and "a token is about 4 characters" (checked 2026-10-18)
- Gemini token counting is not billed (checked 2026-10-18)
What a token is
Why the same text costs different amounts on different models.
01
Tokens are pieces of words
Models read and bill text in tokens: common words are one token, rare words, numbers and code split into several. Each provider trains its own tokenizer, so one prompt can be a different number of tokens on GPT, Claude and Gemini.
02
The context window is a hard limit
A model can only read so many tokens at once, and the window holds your prompt and the reply together. The counter adds the tokens you keep for the reply, so you can see whether a long document will fit before you send it.
03
Exact or estimate, always labelled
OpenAI publishes its tokenizers, so those counts run here exactly. Claude and Gemini are counted by the providers’ own free count endpoints when available. When they are not, the number is an estimate and the page says how it was made.
FAQs · Token counter
Token counting · frequently asked questions
Exact and estimated counts, privacy, and why providers disagree about the same text.
Next step
Building a product on top of an LLM?
QalbIT builds AI features into web and mobile products, with prompts, retrieval and caching designed around what each request costs.
More free tools
More free tools
Each one opens on a worked example and shows its answer without a signup.
All free toolsLLM API pricing comparison and cost calculator
OpenAI, Claude, Gemini and more API prices per 1M tokens, with your monthly cost side by side.
AI agent and RAG cost calculator
What an AI agent and its RAG pipeline cost to run each month, and which line drives the bill.
AI crawler checker and robots.txt tester
Which AI crawlers your robots.txt lets in, GPTBot to PerplexityBot, with the line that decides each.
Robots.txt generator for AI crawlers
Build a robots.txt that blocks AI training crawlers, keeps AI search, or blocks every AI bot.
llms.txt generator and validator
Write an llms.txt from your site’s name, summary and key links, or check one against the proposal.
Software development cost calculator
A typical cost and timeline range for your project, by type, scope and features.