AI token counter & context fit

Paste any text to see how many tokens it's likely to become, whether it fits in a given context window, and what it would cost at your own API rates. Everything runs in your browser — the text is never uploaded.

Nothing leaves this page. Try a document you're thinking of feeding to a model.
0 estimated tokens ±10–15% — see how the estimate works below
Characters0
Words0
Chars per tokenlower = denser text
Rough reading time

Does it fit the context window?

Context windowYour textFits?

Context windows are shared between your input, the model's reply, and anything the app adds behind the scenes (system prompt, retrieved documents, chat history). Leave headroom — filling the window to the brim is how you get truncated answers.

What would it cost?

Input cost
Output cost
Total
Enter the rates yourself, from your provider's current pricing page. We deliberately don't hardcode prices: model pricing changes often, and a stale number here would be worse than no number. Check OpenAI, Google, xAI or DeepSeek.
How this estimate works (and why it isn't exact)

Real tokenization runs a model-specific BPE vocabulary over your text — and every model family uses a different one, so the "true" count differs per model. Doing that properly in the browser means shipping a multi-megabyte vocabulary per family, which would make this page slow for a number you only need approximately.

Instead this uses a character- and word-based estimator, weighted for whitespace, punctuation and digits, which lands within roughly 10–15% for ordinary English prose. Two known biases: code and heavily punctuated text tokenize denser than the estimate suggests, and non-Latin scripts (Chinese, Japanese, Arabic, Hindi) use considerably more tokens per character than English — often 2–3×.

If you need exactness for billing, use your provider's own tokenizer endpoint. For "will this fit" and "roughly what will this cost", an estimate is the right tool.

What a token actually is

Models don't read characters or words — they read tokens, which are chunks somewhere between the two. Common words are usually one token; longer or unusual words split into several. "Unbelievable" might be three tokens, "the" is one. In English prose, one token averages about four characters, or roughly ¾ of a word.

Everything is priced and limited in tokens: what you send, what comes back, and how much the model can hold at once.

Why your text is denser than you think

Context window ≠ your budget

A million-token window doesn't mean you should send a million tokens. Attention quality degrades toward the middle of very long inputs, latency rises, and cost scales linearly. Retrieval — pulling only the relevant passages — usually beats stuffing the window, and it's cheaper.

FAQ

How accurate is this counter?

Within roughly 10–15% for ordinary English prose. Code and non-Latin scripts skew higher than the estimate. For exact billing figures, use your provider's tokenizer.

Is my text uploaded anywhere?

No. The calculation runs in your browser. There's no request, no logging, no storage.

Why don't you show model prices?

Because they change, and a stale price shown confidently is worse than no price. Enter your provider's current rates and the tool does the arithmetic.

Do images and audio use tokens?

Yes — multimodal inputs are converted into tokens too, at rates that vary by provider and resolution. This tool covers text only.

Related: What is RAG? · Which AI model for which task · All free tools