LLM token counter and cost calculator
Paste text to see how a model splits it into tokens, how many tokens it is, and what that costs as input at each model’s list price. Counts for the OpenAI tokenizers o200k_base and cl100k_base are exact; counts for other model families use the closest available tokenizer and are labelled as estimates.
- Free
- Runs in your browser
- No account
- Nothing is uploaded
How it works
The page loads the same byte-pair-encoding tables OpenAI publishes (o200k_base and cl100k_base) and runs the tokenizer in your browser, so the count is the count the API would bill for those encodings.
Each token is drawn as its own piece, so you can see where words split, how spaces and line breaks are counted, and how scripts such as Tamil or Japanese spread one character over several tokens.
The cost panel multiplies the token count by each model’s input price from the PromptFlowEngine model catalog. Output tokens are your own estimate, because the real number depends on the answer.
The structured-data panel converts a JSON payload to TOON and shows the token count of each form, so you can see what a format change saves before you change any code.
Worked example
These counts were produced by the tokenizer when this page was built.
| Text | Characters | o200k_base tokens | cl100k_base tokens |
|---|---|---|---|
| Summarize the attached incident report in five bullet points for an on-call engineer. | 85 | 17 | 17 |
Limits
- Exact counts apply to the OpenAI encodings only. Anthropic, Google, and other providers do not publish their tokenizers in a form that runs here, so those counts are estimates and are labelled as such.
- Prices are list prices recorded in the catalog with a verification date. They are not an invoice, and they do not include discounts, batch pricing, or cached-input pricing unless the panel says so.
- Chat requests add a few tokens of message framing per message. The counter measures the text you paste.
Questions
Is the token count exact?
For the OpenAI tokenizers o200k_base and cl100k_base, yes: the real tokenizer runs in your browser. For other model families the count is an estimate made with the closest available tokenizer, and the page labels it as an estimate.
Is my text sent anywhere?
No. Tokenizing and cost arithmetic run in your browser. The text you paste is not uploaded.
Why do two models count the same text differently?
Each model family uses its own tokenizer with its own vocabulary, so the same text splits into a different number of pieces. That is why a prompt can cost more on one model than another even at the same price per token.
How many tokens is a word?
It depends on the word and the tokenizer. Common English words are often one token, longer or rarer words split into several, and text in other scripts usually takes more tokens per character. Paste your own text to see the real split.
Privacy
This tool runs in your browser. The text, files and numbers you enter are not uploaded, logged or stored on a server, and no account is needed. The site counts that a tool was used, never what was entered. Privacy and security lists everything the site stores and sends.
Use it where you write prompts
The same engine runs in your editor and your browser, so you do not have to come back to this page.
Chrome Extension
Optimize and improve prompts directly inside your browser, in ChatGPT, Claude, Gemini, Grok, Perplexity, and DeepSeek.
Load unpacked
VS Code Extension
Bring PromptFlowEngine prompt optimization directly into your development workflow.
VS Code Marketplace
Keep going
Lesson: Token Intelligence
The idea behind this tool, with short videos.
Lint and optimize a prompt
Compare model prices and context windows
Count tokens in VS Code
Context Budget Planner
Plan an LLM context window: enter tokens for instructions, tools, history, documents, and output, then see what fits each model and what it costs.
RAG Chunking Visualizer
Free RAG chunking visualizer. Split your text with nine methods, set chunk size and overlap, see every boundary and token count, and test retrieval.