Token Calculator
Estimate token usage from raw text before sending it to an LLM.
Your input is processed in your browser and never sent to a server.
How it works
Tokens are the units LLMs actually process — not characters or words. Most tokenizers split text into subword pieces, so the token count depends on the tokenizer's vocabulary, not just text length. This tool uses a simple character-based approximation so you can get a fast estimate without loading a full tokenizer in the browser.
estimated tokens ≈ ceil(characters / 4)For example, a 400-character paragraph estimates to roughly 100 tokens. Code, non-English text, and unusual punctuation typically tokenize less efficiently than plain English prose, so treat this as a ballpark figure.
Frequently asked questions
Is this an exact token count?
No. This tool estimates tokens using a character-based heuristic (roughly 4 characters per token for English text). Exact counts depend on the tokenizer used by the specific model you're calling.
Why do different models count tokens differently?
Each model family uses its own tokenizer (a fixed vocabulary of subword pieces). The same text can split into a different number of tokens depending on which tokenizer processes it.
Does my text get sent anywhere?
No. The estimate is computed entirely in your browser using JavaScript — your text is never transmitted to a server.