straighten AI

Prompt Length Checker: Count Tokens Before You Send

Paste a prompt to see an estimated token count, plus words, characters and lines, and how much of a 128K, 200K or 1M-token context window it would fill. The token count is an estimate (characters divided by 4), not a real tokenizer count. Optional AI suggestions say whether the prompt looks too long, too short or about right, and what to change. Your prompt is sent to our server to count it, and to an AI model through OpenRouter only if you ask for suggestions. We don't store it.

Built by Jose Hunt · Checked 20 Nov 2026

Your Prompt
Tokens 0
Words 0
Characters 0
Lines 0
memory Context Window Usage
info

How to use

Paste your prompt to see token counts, model limits, and get AI-powered optimization tips.

Tokens: o200k_base, exact for recent OpenAI models. Compare cost by model in the Token Counter.

  • check_circle Tokens, words & characters
  • check_circle 128K, 200K & 1M context bars
  • check_circle AI-powered optimization suggestions

What is a Prompt Length Checker?

A prompt length checker tells you how long a prompt is, and whether it fits a model's context window, before you send it. Models read text as tokens, not words, and each model has a context window: a cap on the tokens it can handle in one request, counting your prompt and its reply together (Anthropic).

Paste a prompt and you get four numbers: tokens, words, characters and lines. Below them, three bars show what share of a 128,000, 200,000 and 1,000,000-token window the prompt would fill. The counting runs on our server with fixed rules and no AI. Get AI Suggestions is a separate button that sends your prompt to an AI model through OpenRouter.

The limit: tokens are counted with o200k_base, the tokenizer OpenAI uses for GPT-4o, GPT-4.1 and the GPT-5 family. For those models the count is exact. Claude, Gemini and other models split text their own way, so for them it's an estimate. To compare price and context window model by model, use the Token Counter.

For ways to shrink a prompt, see how to reduce AI prompt tokens. To cut tokens with AI, use the Token Reducer.

When should you use it?

  • check_circle Checking that a system prompt plus a pasted document won't run into a model's context limit
  • check_circle Comparing two drafts of a prompt to see which is shorter before it goes into an app
  • check_circle Getting a rough token figure to estimate the cost of a prompt you'll send many times
  • check_circle Getting a quick second opinion on whether a prompt is vague or padded

Example outputs

Input (a 4-line support-bot system prompt, ⏎ marks a line break): "You are a customer support assistant for an online shoe shop. Answer questions about orders, returns and sizing.⏎Always be polite. Don’t promise refunds; say the returns team will review the request.⏎If the customer gives an order number, repeat it back so they can check it.⏎Keep each reply under 120 words and end with: "Is there anything else I can help with?""
Result: 77 tokens, 65 words, 363 characters, 4 lines. Context bars: 0.06% of 128K, 0.04% of 200K, 0.01% of 1M. Get AI Suggestions called the prompt "well-sized and structured" and made three suggestions: name a specific brand voice instead of just "polite", say what to do if the order number is missing, and add "Prioritize brevity; do not use filler phrases." It ended with a rewritten version as a numbered list, starting "You are an empathetic (...) customer support assistant for [Brand Name]." (...)
What to notice: the AI suggestions made the prompt longer, not shorter. That's expected, because the model is asked whether the prompt is the right size, not told to cut it. The rewrite added a [Brand Name] placeholder you'd have to fill in. Don’t counts as two words because it was typed with a curly apostrophe. AI suggestions run on 20 November 2026; token count rechecked with o200k_base on 25 November 2026. AI output varies, so yours won't match word for word.

How it works

Tokens: your prompt goes through the o200k_base encoding (Microsoft.ML.Tokenizers, the same encoding as OpenAI's tiktoken library). tiktoken maps OpenAI's GPT-4o, GPT-4.1, GPT-5 family, o1, o3 and o4-mini models to it (tiktoken, checked 25 November 2026), so for them the count is exact. Other models use their own tokenizers, so for them it's an estimate that can be off either way.

Words: each unbroken run of letters, digits, underscores, straight apostrophes and hyphens. A curly apostrophe splits a word, so don’t typed with a curly apostrophe counts as two words, and don't with a straight one counts as one. Characters: everything in the box, including spaces and line breaks, counted in UTF-16 units, so most emoji count as 2. Lines: line breaks plus one, so a line break at the very end adds an empty line.

Context bars: the token count divided by 128,000, 200,000 and 1,000,000, shown to two decimal places. These sizes are fixed in the code and don't follow new model releases. 128,000 is GPT-4o's context window, while the original GPT-4 has 8,192 (OpenAI GPT-4o, OpenAI GPT-4). 200,000 is the window of Claude Haiku 4.5, Sonnet 4.5 and older Claude models; Anthropic's newer models have 1M (Anthropic). 1,000,000 matches the Gemini models Google lists (Google). Past 100%, the percentage keeps climbing but the bar stays full and keeps the same colour.

The counts update as you type, on our server. Your prompt isn't stored.

Get AI Suggestions sends your prompt to an AI model through OpenRouter. The model is asked to judge whether the prompt is too verbose, too terse or well-sized, suggest specific improvements, and keep its answer under 200 words. The answer streams in as it's written and varies between runs.

Tips for better results

  • tips_and_updates For GPT-4o, GPT-4.1 and GPT-5 models the count here is exact. For Claude, use Anthropic's token counting endpoint, which is free to use with rate limits (checked 25 November 2026).
  • tips_and_updates Leave room for the answer. The context window holds the prompt and the reply, so a prompt that fills 95% leaves little space for output.
  • tips_and_updates Look up your own model's context window in its provider's docs. The three bars are fixed reference sizes, not your model's limit.
  • tips_and_updates Treat the AI suggestions as a review, not a fix. They can add instructions, so check the token count again after you apply them.

Frequently Asked Questions

How are tokens counted?
By estimate: characters divided by 4, rounded up. That's OpenAI's rule of thumb for English text (OpenAI). No tokenizer is run, so code, URLs and non-English text can be well off. For an exact count, use your model provider's tokenizer.
Which context windows does it show?
Three fixed sizes: 128,000, 200,000 and 1,000,000 tokens, labelled GPT-4o, Claude 4.5 and Gemini. Treat them as reference points. GPT-4o has 128,000 but the original GPT-4 has 8,192 (OpenAI), and Anthropic's newer Claude models have 1M (Anthropic). Check your own model's docs for its real limit.
What happens if my prompt is over the limit?
In this tool, the percentage goes past 100% and the bar stays full. With a real model, it depends on the provider. Anthropic's API, for example, rejects a request whose input alone is bigger than the context window with a "prompt is too long" error (Anthropic).
Does it use AI?
Only if you click Get AI Suggestions. The counts and percentages use fixed rules on our server. The suggestions come from an AI model through OpenRouter, which is asked to keep them under 200 words, and they vary between runs.
Is my prompt stored?
No. To count it, your prompt is sent to our server over an encrypted connection and isn't saved. If you use AI suggestions, it's also sent to an AI model through OpenRouter. We don't store it. OpenRouter and the model provider handle it under their own policies, which our Privacy Policy explains.

Related tools