Prompt Length / Token Counter

Count characters, words, and estimated tokens in your prompt live, and check it against common context window limits.

Free to use
No sign up
Instant results
Copy & use
token-counter --estimate
0characters
0words
0sentences
0est. tokens

Token estimate uses the common ≈4-characters-per-token rule of thumb. It won't match any model's exact tokenizer, but it's close enough to gauge whether you're near a limit.

Context window sizes change often between model versions — these are rounded reference points, not live figures. Check your provider's docs for the current exact limit.

0% of 200K tokens used

Token count isn't the same as word or character count — it's the actual unit models bill and limit by, and it varies by model since different tokenizers split text differently. This tool counts tokens for your exact prompt against several common model tokenizers side by side, so you know your real cost and context usage before you run anything.

How to use it

1
Paste your prompt text

Works on any text — a prompt, a full conversation, or a document you're about to send to a model.

2
Select which model tokenizers to compare

Token counts differ between models, sometimes significantly, for the exact same text.

3
Review the counts and estimated cost per model

Cost estimate uses each model's current public per-token pricing.

Tips for better results

  • Count the full conversation, not just your latest message, for context-limit planning. Context limits apply to the whole conversation history, not just what you're about to send.
  • Check multiple models if you're deciding where to send a long prompt. The same prompt can cost meaningfully more on one model's tokenizer than another's.
  • Recount after editing, especially after adding examples. Few-shot examples add tokens fast — a couple of examples can double a short prompt's count.

Example output

“A 200-word prompt comes out to roughly 260 tokens on one common tokenizer and 245 on another — a small but real difference that matters at scale or near a context limit.”
Tokenizers: Multiple Shows: Cost Estimate

TL;DR

Type or paste your prompt and watch character, word, sentence, and estimated token counts update live, then check the total against a rough context-window limit so you know how much room you have left before you hit an error mid-request.

Why it helps

Token counts matter more than character or word counts once you’re working with long prompts, few-shot examples, or system prompts close to a model’s limit. AI models don’t process text as words — they break it into tokens, chunks that are usually a bit shorter than a full word for common English text, but can be longer or shorter depending on punctuation, whitespace, and language. That mismatch between what you see (words) and what the model counts (tokens) is exactly why prompts that look short on screen can quietly eat through more of a context window than expected.

This tool uses the common ≈4-characters-per-token approximation, a rule of thumb that’s close enough for most English prose to flag when you’re approaching a limit, even though it won’t match any specific model’s exact tokenizer. Code, non-English text, and unusual formatting all tend to tokenize less predictably than plain prose, so treat the estimate as a warning system, not a precise measurement.

Why token counts matter more than they used to

Early chatbot interfaces made context limits mostly invisible — a short conversation rarely got close to any ceiling. That’s changed. Long system prompts, multi-shot examples, pasted documents, and multi-turn agent workflows all consume context fast, and running out mid-task usually means truncated instructions or a dropped conversation history, not just a clean error message. Knowing your rough token count before you hit send is the difference between debugging a mysterious quality drop and understanding exactly why it happened.

This matters even more for anything meant to be reused — a system prompt embedded in an app, a template shared across a team, or a prompt library entry — since those get pasted into different contexts with different available headroom every time they’re used.

Reading the context-window options

The dropdown groups context windows into rounded classes — short-context assistant, mid-range assistant, Claude Sonnet/Opus class, and GPT-5-class or Gemini Pro-class — rather than pinning to one exact model version. That’s deliberate: context window sizes change often as providers release new model versions, sometimes within weeks of each other, so a number hardcoded to one specific model name goes stale fast. If you’re checking against a specific deployment, use the Custom limit option and enter your provider’s documented figure directly rather than relying on the presets.

Who this is for

Anyone building prompts that push toward a model’s limits benefits from this — developers assembling system prompts with several few-shot examples, teams maintaining a shared prompt library where prompts get pasted into different tools with different limits, or anyone who’s had a long prompt silently underperform and wants to rule out length as the cause before troubleshooting anything else. It’s also worth a quick check before pasting a long document into a chat window — knowing roughly how much of your budget the document alone will consume tells you upfront how much room is left for instructions and follow-up questions in the same conversation.

Common mistakes this tool avoids

Assuming words and tokens are the same thing — punctuation, code, and non-English text tokenize very differently — and budgeting a prompt against the model’s full context window with no room reserved for the answer.

FAQ

Is the token count exact?

No. It’s an estimate based on the common ≈4-characters-per-token rule of thumb. Actual tokenization varies by model and can differ, especially for code, non-English text, or unusual formatting.

Why do the context window options say “class” instead of a specific model name?

Context window sizes change often between model versions. These are rounded reference points — check your provider’s current documentation for the exact number, especially if you’re working close to a limit.

Does this tool send my prompt anywhere?

No. Everything runs in your browser; nothing is uploaded or stored.

Why does my prompt use more tokens than I’d expect from the word count?

Punctuation, unusual formatting, code, and non-English text all tend to tokenize less efficiently than plain English prose, so the token count can run noticeably higher than a simple word count would suggest.

Should I always try to minimize token count?

No — the goal is staying under your limit with room to spare, not writing the shortest possible prompt. Cutting context or examples to save tokens often hurts output quality more than the extra length was costing you.

Related