Free browser tool
Token Calculator & Counter for LLMs
Count tokens in prompts, documents, code, and chat messages. Estimate API costs before you send a request.
Tokenization guideToken visualization
Text is processed in your browser, not sent to our counting API. One reference tokenizer is used for this count. Model-specific tokenizers, message formatting, and tool definitions can change the billed total.
Model cost comparison
No token count to compare yet.
What does the calculator measure?
Language models read text as tokens. A token may be a whole word, a fragment, or a punctuation mark. Count the text first, then use the cost calculator to budget input and output separately.
From text to a budget
- Paste the prompt, document, or code you want to measure.
- Read its token, word, and character counts; inspect the token boundaries below.
- Compare estimated costs, then shorten the prompt or choose a model to suit your budget.
Common questions
What is a token calculator?
A token calculator counts the text units an LLM processes before a request. Token-Calculator.net counts tokens, words, characters, and characters without spaces, then uses that token count to estimate LLM API cost.
Does this token calculator upload my text?
No. The public calculator runs locally in your browser, so pasted text is not sent to Token-Calculator.net servers for the browser tool.
Does this token calculator work for OpenAI, Claude, and Gemini?
It pairs a reference token count with prices from all three providers. It does not run every model's tokenizer: provider-specific tokenization, message formatting, and tool definitions can change the billed count. Use the provider's usage response to reconcile actual costs.
Is the browser token calculator free?
Yes. The public browser calculator is free to use. Paid plans are only needed for API access.
Need counting in your app?
The browser calculator is free. Token API access costs $1.99 monthly or $9.99 yearly.
Explore the Token API