Every prompt has two sizes: the content you mean to send, and the text you actually send. Between them sits dead weight: blank lines stacked three deep, the same instruction repeated in different words, heavy formatting wrapped around a simple list. Those extras cost tokens, and tokens are what context limits and per-token prices are charged in. Most of that dead weight can be removed without cutting a single idea. This guide shows where it hides, how to strip it, and how to verify the saving with a real count from the Token Counter on Ovatly, which runs a real BPE tokenizer in your browser and never uploads your text.
One promise this guide will not make: a percentage. How much you save depends entirely on how much overhead your prompt carries, and anyone quoting a fixed saving in advance is guessing. What you get instead is a method that ends with two real numbers: before and after.
Contents
- Quick answer
- Where non-content tokens hide
- Whitespace and blank lines
- Repeated phrasing
- Formatting overhead
- How to trim a prompt, step by step
- Worked example: what the counter shows you
- Limitations and the floor
- Common mistakes
- FAQs
- Conclusion
Quick answer
To reduce tokens without cutting content, work on presentation, not meaning: collapse excess blank lines and doubled whitespace, say each instruction once, and keep formatting only where it helps the model read the prompt. Then verify: paste the original into the Token Counter, note the count, trim, paste the trimmed version and count again. The difference is your real saving. Expect the content itself to set a floor you cannot trim below, and remember that chat APIs add a few tokens per message on top.
Where non-content tokens hide
A tokenizer splits text into sub-word pieces, and it processes everything you paste, not just the parts that carry meaning. Punctuation and spaces attach to neighboring tokens, and every line break and repeated word is text it has to handle. That is why a prompt can shrink while saying exactly the same thing: you are removing text that was never content.
The counter makes this visible. Alongside the token count it shows characters, and characters without spaces. On the tool page's own example, the greeting "Hello, world!" is 13 characters but 12 characters without spaces: even a two-word line carries characters beyond its words. Scale that up to a long, spaced-out prompt and the overhead stops being trivial. The three hiding places below cover nearly all of it.
Whitespace and blank lines
Whitespace is the easiest win because none of it is content. Drafts accumulate it quietly: two or three blank lines between sections where one would do, spaces trailing at line ends, indented blocks pasted from documents. None of that changes a single instruction, example or fact in the prompt.
The fix is mechanical. Keep one blank line between sections, remove trailing spaces, and unindent pasted text that does not need its original indentation. Be careful in exactly one place: inside code, tables or examples where spacing is part of the content itself. There, trimming would change what you are sending. Everywhere else, it is safe to strip.
Repeated phrasing
Repetition is the second hiding place, and it is usually well intentioned. Writers repeat an instruction because it matters: once in the opening line, again in a constraints list, a third time in a closing reminder. Each restatement costs tokens and adds nothing the model did not already receive. The same applies to boilerplate: stock introductions and sign-offs pasted into every prompt out of habit, long after anyone checked whether they change the output.
Read the prompt once with a single question: does this sentence tell the model anything it has not already been told? If the honest answer is no, delete it; the content survives in the first statement. Keep the clearest version of each instruction and remove its echoes.
Formatting overhead
Formatting is the subtlest of the three, because some of it earns its tokens. Clear headings and a simple list genuinely help a model follow a structured prompt. But formatting can also balloon: nested bullet levels, decorative separators, markdown tables used for two items of data, and repeated labels on every line. Each of those marks is text, and text is tokens.
There is also overhead you cannot trim. Real chat APIs add a few tokens per message for role markers and structure, and the counter counts raw text only, so that cost sits outside your control. What you can control is the formatting inside the message: keep the structure that aids reading, flatten the decoration.
How to trim a prompt, step by step
- Paste the original prompt into the Token Counter and click Count tokens. Write down the token count; this is your baseline.
- Make a copy of the prompt and work on the copy, so the original survives if you trim too far.
- Clean the whitespace: one blank line between sections, no trailing spaces, no unnecessary indentation outside code and examples.
- Remove repetition: each instruction stated once, boilerplate deleted unless you can name what it changes.
- Flatten decorative formatting while keeping the structure that helps the prompt read clearly.
- Paste the trimmed version into the counter and count again. The difference between the two counts is your saving, measured, not promised.
- Read the trimmed prompt end to end before using it, confirming every instruction, example and fact from the original is still present.
If trimming by hand feels slow for a prompt you reuse daily, the tool page lists a Prompt Shortener among its related tools; the manual loop above is still the way to check what any shortening actually did.
Worked example: what the counter shows you
The tool page's counted examples show the scale of the units you are working in. "Hello, world!" is 4 tokens. "The quick brown fox jumps over the lazy dog" is 9 tokens. A full sentence, "Prompt engineering is the practice of writing instructions for AI models.", is 12 tokens.
Hold those against a typical long prompt. A repeated instruction is often a small paragraph, and a handful of restatements, a few stacked blank lines and a decorative table can add up to a short paragraph of overhead. The habit matters more than any single figure: count your prompt, trim one category of overhead, count again, and you can see which category was actually costing you, measured on your text.
Limitations and the floor
Trimming has a floor, and it is the content itself. Frequent words tend to be single tokens and unusual words become several, so a dense, technical prompt costs what it costs; no amount of whitespace cleaning turns it into a short one. Code and non-English text usually take more tokens per word, which raises the floor further. The count is exact for the GPT-4o family encoding the counter uses and a close approximation for Claude, Gemini and other families. And the count covers your raw text; the final API payload adds a few tokens per message for structure. The honest goal is a lean prompt, not a tiny one.
Common mistakes
- Cutting content to hit a number. If a sentence carries an instruction, an example or a fact, it is content. Removing it changes the prompt, the one thing this method promises not to do.
- Trusting a promised percentage. Savings depend on the overhead your prompt carries. Measure your own before and after instead.
- Trimming inside code or data. Spacing in code blocks and aligned data can be content. Clean the prose around them, not the blocks.
- Forgetting the chat overhead. Your trimmed count is the content size; the API adds structure tokens on top, so leave headroom against a context limit.
- Counting once and editing later. Any later edit changes the figure. Count the version you actually send.
FAQs
How much will I save by trimming a prompt? There is no honest fixed figure. It depends on how much whitespace, repetition and formatting your prompt carries. Count the prompt before and after trimming with the Token Counter and the difference is your real saving, for that prompt.
Does removing whitespace change what the prompt says? No. Extra blank lines, doubled spaces and trailing whitespace carry no content; the words, instructions and data stay identical. What changes is only how much non-content text the tokenizer has to process.
Does chat formatting add tokens? Yes, real chat APIs add a few tokens per message for role markers and structure. This tool counts the raw text only, so treat the result as the content size, not the final API payload.
Is this the exact count for Claude or Gemini? No. It is exact for the GPT-4o family encoding it uses, and an approximation for other families. Providers' own counters are the authority for their models.
Is my text uploaded for counting? No. The tokenizer runs in your browser; nothing leaves the page.
Conclusion
Reducing tokens without cutting content is housekeeping, not editing: strip the whitespace, repetition and decorative formatting that carry no meaning, keep every instruction and fact, and prove the result with two real counts. The Token Counter gives you those counts in your browser, privately, in seconds. For more, see the AI and Prompt Tools guides, and if you are still deciding how big your prompt really is, start with the companion guide, How Many Tokens Is a Page of Text?.