What this tool tells you
Some of the tokens in your prompt carry meaning. Others are indentation, trailing spaces, blank lines and repeated JSON punctuation — structure that exists for human readers and does nothing for the model. You pay identically for both. This tool separates them, shows the difference in tokens, and converts it into a monthly and annual figure at your request volume.
The honest headline: on English prose the saving is two or three percent and not worth your afternoon. On pretty-printed JSON, tabulated data or deeply indented code it is routinely thirty to fifty percent, and it recurs on every request forever. The tool shows your actual number rather than a marketing one.
What each transformation does
Minify JSON
Re-serialises valid JSON without indentation or line breaks. Almost always the largest single win, because pretty-printing adds two to four tokens per line and a nested object has a lot of lines. If the input is not valid JSON the transformation is skipped rather than applied destructively.
There is no evidence that indentation helps a model parse well-formed JSON — the structure is carried by the braces and commas, not the layout. Minify what you send, keep the readable version in your logs.
Collapse repeated spaces
Runs of two or more spaces become one. This catches aligned tables, padded columns and the artefacts of string concatenation. Single spaces between words are deliberately left alone — see below, because this is where people go wrong.
Trim line ends and collapse blank lines
Trailing whitespace is invisible in your editor and billed like anything else. Runs of three or more newlines collapse to two, which preserves paragraph separation while removing accidental gaps.
The optimisation that backfires
The instinct is to strip all whitespace. Do not. In most byte-pair vocabularies the leading space is part of the word token — the encoder learned " the" as a unit, not "the". Removing spaces between words forces it off those common merges and onto fragments, and the token count goes up.
The distinction that matters is structural whitespace versus semantic whitespace. Indentation, alignment padding and trailing spaces are structure, and removing them is free. Word spacing is semantic, and removing it costs you twice: more tokens and worse comprehension. Watch it happen in the tokenizer playground — paste a sentence, then paste it again with the spaces removed, and compare.
Beyond whitespace
The automatic transformations here are the safe, lossless ones. The larger savings usually require judgement:
- Repeated JSON keys. An array of 500 objects repeats every key 500 times. Sending column headers once and rows as arrays can halve a payload.
- Base64 in prompts. Encodes at roughly one token per two characters and is nearly always avoidable.
- Restated instructions. The same rule expressed three ways out of caution costs three times as much and does not improve compliance. The system prompt analyzer finds these by showing what each paragraph costs per year.
- Whole documents where a passage would do. The largest saving available to most teams, and it is a retrieval problem — see the text splitter.
Is it worth doing
Multiply the tokens saved by your monthly request count and look at the annual figure the tool shows. Below a few hundred dollars a year, spend your attention elsewhere. Above a few thousand, this is one of the highest-return hours available to you, because unlike most optimisations it is permanent and carries no accuracy risk. Model the full picture in the cost calculator.