LLM Token Counter (Estimate).
Estimate how many LLM tokens a prompt uses, with a breakdown by words, numbers, symbols and scripts.
Runs in your browserAbout LLM Token Counter (Estimate)
The LLM Token Counter gives a quick estimate of how many tokens a piece of text will use, so you can check a prompt against a context window or budget before you send it. It is an estimate, not an exact count: every model family has its own tokenizer and vocabulary, and the same sentence can be 10 to 15 percent longer or shorter depending on the model. The counter imitates how byte-pair-encoding tokenizers split text. It separates words together with their leading space, contractions such as 're and 'll, digits in groups of up to three, runs of punctuation and whitespace, and then estimates tokens per piece: short English words are usually one token, long words are split into several, Cyrillic and other non-Latin scripts take roughly one token per two or three letters, and Chinese, Japanese and Korean text takes about one token per character. For example, "Hello, world! This is a test." comes out at nine tokens, which matches common tokenizers. The breakdown table shows where the tokens come from, which explains why code, JSON and non-English text cost more than plain English prose: punctuation and indentation add up quickly. A typical mistake is budgeting by words or characters alone; the characters per token figure in the result shows how far your text is from the usual four characters per token. When you need the exact number for billing, use the tokenizer or token-counting endpoint of your provider. Your text never leaves the browser.
How to Use
- Paste a prompt, a document or a code file into the text field.
- Read the estimated token count, the likely range and the characters-per-token ratio.
- Use the breakdown to see whether words, symbols, whitespace or non-Latin text drive the count.
Frequently Asked Questions
How accurate is the estimate?
For English prose and typical code it is usually within 10–15% of real tokenizers. It can drift further for unusual text such as long numbers, base64 blobs or rare scripts. The likely range shows ±15%.
Why not count tokens exactly?
Exact counts need the model's own vocabulary, which differs between providers and model generations and is several megabytes large. This tool stays small and offline; use your provider's tokenizer or token-counting API for billing-grade numbers.
Why does non-English text use more tokens?
Tokenizer vocabularies are trained mostly on English, so common English words are single tokens while words in other languages are split into several pieces.
Is my text uploaded?
No. The estimate is computed in your browser and nothing is sent to a server.
Related Tools
Work out per-request, daily and monthly LLM API costs from your token counts and per-million-token prices.
Fill {{variables}} in a prompt template, find missing or unused ones, and diff two prompt versions.
Count characters, words, sentences, and more.
Convert Chat Completions requests to Anthropic Messages requests and back, including tools and images.
View JSON Lines as a table, convert JSONL ↔ JSON arrays, and check chat fine-tuning datasets.
Wrap a JSON Schema as a function/tool definition for OpenAI, Anthropic and MCP, with optional strict mode.