← All tools

Prompt Token Counter & Trimmer

How many tokens is this prompt — and which words are just costing you money?

Why this exists

Every call to Claude, GPT or a local model is billed per token and cut off at the context window, and token counts are invisible while you write. This estimates the count as you type (honestly labelled as an estimate — exact numbers need the vendor's own tokenizer), shows how much of each context window the prompt eats, and suggests a trimmed version with the filler removed and every removal listed.

🔒 Runs in your browser — nothing is sent anywhere

Counted in the page — your prompt is never sent anywhere, which matters, because prompts routinely contain the exact things you would not paste into a random website.

62tokens (±10%)

211 chars · 38 words · 1 lines

An estimate from how BPE tokenizers behave — short words ≈ 1 token, long words split ~every 4 characters, code runs denser. Exact counts need the vendor’s own tokenizer; for billing-grade numbers use the provider’s count-tokens API.

Estimated token boundaries
Please can you write a Python script that parses nginx access logs. Make sure to handle gzipped files as well. It is important that the output is valid JSON. Please be as detailed as possible. Thanks in advance!

Each colour is one estimated token — these are the boundaries behind the count above. A vendor’s real tokenizer merges slightly differently, but the picture is representative: notice how “please” and punctuation each cost their own token.

Context-window fit
8k (small local models)0.78%
128k (GPT-4o class)0.05%
200k (Claude class)0.03%
1M (long-context class)0.01%

Remember the window holds the whole conversation — system prompt, history and the answer — not just this prompt.