Skip to content

Token Counter & Context Visualizer

Estimate the token count of any prompt or file, see how much of each model's context window it fills, and what it costs to send.

Share
0
Est. tokens
0
Characters
0
Words
0
Lines

Context window usage

Paste some text to see how it fills each model's context window.

Token counts are estimates, not exact. Every provider tokenizes differently and only OpenAI publishes its tokenizer, so an exact cross-provider count is not possible in the browser. Counting Claude text with OpenAI's tiktoken undercounts by roughly 15 to 20 percent, which is worse than an honest estimate. For an exact figure, use the provider's own endpoint: Anthropic's count_tokens, or OpenAI's tokenizer library.

Prices verified 2026-08-15. Costs shown are for sending this text once as input, excluding any output tokens. 15 further models are priced in the cost calculator but omitted here, because their provider does not publish a context window and a guessed one would be worse than none.

How to use Token Counter & Context Visualizer

1

Paste your text

Drop in a prompt, a document, or a source file. It stays in your browser; nothing is uploaded.

2

Read the token estimate

You get an estimate plus a likely range, because each provider tokenizes differently. Plan against the upper figure.

3

Check it fits, and what it costs

Each bar shows how much of that model's context window the text fills, alongside the cost of sending it once as input.

What a token actually is

A token is a chunk of text a model treats as one unit, produced by a byte-pair encoder that merges frequent character sequences. Common English words are usually a single token, rarer words split into several, and a space normally attaches to the word that follows it rather than costing anything by itself.

The practical rule for English prose is about four characters per token, so roughly 750 words per thousand tokens. Source code runs denser, closer to three characters per token, because punctuation, brackets and operators each tend to be their own token. Languages without spaces between words, such as Japanese and Chinese, run near one token per character, which is why the same document can cost several times more in one language than another.

This matters beyond billing. Everything a model handles is measured in tokens: the context window, the output cap, and the rate limits on your account are all token quantities, not character or word quantities.

Fitting the window is not the same as using it well

A million-token context window does not mean a million-token prompt is a good idea. Models retrieve less reliably from the middle of a very long context than from its start or end, so burying the important paragraph at the halfway mark of a huge document is a common and hard-to-debug failure.

Cost and latency both scale with input size, and unlike output tokens you pay for every input token on every request, including the parts the model did not need. Sending a whole file when a single function would do is the most common source of a surprising bill.

When a prompt is uncomfortably large, the fix is usually better retrieval rather than a bigger window: send the three relevant sections instead of the whole document. Where the same large prefix genuinely does repeat across requests, prompt caching is the tool for it, and the cost calculator will show you what that saves.

Nothing leaves your browser

Counting runs entirely on this page. Prompts and documents are exactly the sort of content that should not be pasted into someone else's server: they routinely contain proprietary source, customer records, unreleased material, and internal strategy. Nothing here is uploaded, logged, or sent anywhere.

Frequently Asked Questions

Why is this an estimate rather than an exact count?

Exact counting needs the tokenizer the model actually uses, and only OpenAI publishes theirs. Anthropic does not release a Claude tokenizer; its count_tokens endpoint is the only exact source. Using OpenAI's tiktoken on Claude text undercounts by roughly 15 to 20 percent, so an honest estimate with a stated range is more useful than a precise-looking wrong number.

How accurate is the estimate?

Typically within about 15 percent, which is the range shown under the count. It is most accurate on English prose, slightly less so on source code, which packs more tokens per character because of punctuation and symbols. Plan capacity against the upper end of the range.

How do I get an exact count?

Use the provider's own endpoint. Anthropic offers a count_tokens API call that takes the same messages payload as a real request and returns the exact input token count without running inference. OpenAI publishes its tokenizer as a library you can run locally.

Why do some models not appear in the context list?

Only models whose provider publishes a context window are drawn. Where a provider does not publish one, the model is priced in the cost calculator but omitted here, because a guessed context window looks authoritative and would be worse than showing nothing.

Does a full context window mean the model will work well?

No. Fitting inside the window is a hard requirement, not a quality guarantee. Retrieval accuracy commonly degrades well before the limit, and cost and latency both scale with prompt size. If you are above roughly three quarters of a window, the usual fix is better retrieval rather than a larger model.