LLM Token Counter
Before you paste a long document into a chat model or an API request, it helps to know roughly how many tokens it will use. This tool counts characters and words in your browser and applies a transparent rule of thumb to estimate tokens, with a range to show the uncertainty. The result is meant for planning prompts, context-window headroom and rough budgets. It does not use any provider's tokenizer, so treat the number as an estimate and verify it with your provider when a limit is strict.
Your workspace
Runs locally in your browserResult
Your input is processed locally in your browser and is not sent to Flutters servers. Inputs are not saved by this tool.
How to use this tool
Paste your prompt or document, choose Estimate tokens, then read the characters, words and estimated range. Copy the summary or clear the text.
Example
Input
Summarize the following release notes in three bullet points.Output
Characters: 62
Words: 10
Estimated tokens: about 15 (range 12–19)What does this tool do?
Language models read text as tokens, which are pieces of words, punctuation and whitespace chosen by a model-specific tokenizer. This counter reports characters, words and an estimated token count, plus a plausible range. The estimate uses a general rule of thumb rather than any vendor's tokenizer, so it is useful for sizing and budgeting but not for enforcing a hard limit.
Common mistakes and limitations
This is an approximation, not an exact token count. Real tokenizers differ by model and version, split code, numbers and non-English text differently, and add special tokens or message formatting that this page cannot see. Leave headroom below a context limit, and use your provider's own token-counting feature when an exact figure matters.
Tokens, context windows and input versus output
A token is a unit a model reads or writes: often a whole short word, part of a longer word, a number fragment or a punctuation mark. A context window is the total token budget for one request, and it normally has to hold your instructions, any supplied documents and the reply. Many APIs count input tokens and output tokens separately, so a long prompt and a long answer both consume budget and both can be billed.
Related: AI API Cost Calculator
Why two tokenizers give different counts
Each model family trains its own tokenizer, with its own vocabulary and splitting rules. The same sentence can therefore cost a different number of tokens in different models, and code, URLs, emoji and languages such as Japanese or Hindi often split into more tokens than plain English prose. That is why this page reports an estimate and a range. Use it to compare drafts and to leave headroom, then confirm with the provider's token counter before relying on a limit.
Same text, different tokenizers:
"Flutters.in tools" -> tokenizer A: 5 tokens
"Flutters.in tools" -> tokenizer B: 6 tokensPlanning a prompt that fits
Count the system prompt, the user input and any retrieved passages, then reserve room for the reply. If the total is too large, shorten instructions first, then split long source text into smaller passages.
Related: RAG Text Chunker, Prompt Template Builder, Word and Character Counter
Frequently asked questions
Is the token count exact?
No. It is an estimate based on text length and word shape. Different models tokenize the same text differently, so confirm exact counts with the provider you use.
Does my text leave the browser?
No. Counting runs in your browser and the text is not sent to Flutters servers.
What is a context window?
It is the maximum number of tokens a model can consider in one request, usually covering the prompt, any retrieved text and the generated reply together.
Related tools
AI API Cost Calculator
Turn input and output token counts and per-million prices you enter into per-request and multi-request cost estimates.
Open tool AI & LLM ToolsRAG Text Chunker
Split text into overlapping chunks by characters, words or estimated tokens for retrieval-augmented generation, and copy any chunk.
Open tool AI & LLM ToolsPrompt Template Builder
Write a prompt with {{variables}}, fill the detected fields or paste JSON values, and copy the finished prompt. Plain replacement only.
Open tool Text ToolsWord & Character Counter
Count words, characters, sentences and reading time.
Open tool