Skip to content

Prompt Compression Preview

Applies six deterministic compression rules to a prompt and lists exactly what each one removed, with the estimated tokens and monthly cost saved.

Nothing is uploaded. Your prompt is read with FileReader inside this tab and never leaves it — there is no server call on this page, and the text is kept out of the URL as well, so the link you share carries your settings and not your content.

Estimated tokens after compression
110

Down 54 from 164 — 32.9% smaller. At 100,000 requests a month that is $16.20 of input.

Characters before / after
627 → 403
Lines before / after
21 → 18
Estimated tokens before
164
Estimated tokens after
110
Rules that fired
9
Monthly input cost before
$49.20
Monthly input cost after
$33.00

Estimated, not tokenized. Token figures here come from an approximation running in your browser: no tokenizer vocabulary is downloaded, because a real one is megabytes and nothing on this page fetches anything. It imitates how a byte-level BPE splits text — words, digit groups, punctuation runs, whitespace runs — but it has no merge table, so treat it as a planning number. The authoritative count is the usage object on a real API response.

Exactly what was dropped

RuleTimesEst. tokensWhat it hit
in order to → to24"In order to", "In order to"
due to the fact that → because13"Due to the fact that"
it is important that → (cut)17"It is important to note that"
please note that → (cut)13"Please note that"
as mentioned above → (cut)17"As previously mentioned above,"
make sure to → always15"you should always make sure to"
Duplicate lines dropped121"- to answer a question about an invoice, you must first check the account status."
Runs of spaces collapsed24
Repeated blank lines collapsed10

The compressed prompt

Copy this and diff it against yours before you ship it.
# Support Assistant

## Role

you are a support assistant for a billing product.
always answer in **British English**.

## Rules

- to answer a question about an invoice, you must first check the account status.
- because refunds are irreversible, never promise one.
- do not speculate about future pricing.

## Tone

Be concise. Be concrete. Never apologise twice.

Answer with at most three sentences.
What this assumes: Every rule here is textual and deterministic — no model rewrites anything, so nothing can be invented or hallucinated away. The filler list is a fixed set of English phrases, so it does nothing on a prompt in another language. "Duplicate lines" means byte-identical after trimming, not similar. Stripping markdown assumes the model does not need the structure, which is not always true: headings and bullets are how many prompts signal sections, and removing them can change behaviour even though it never changes meaning to a human reader. The monthly figure counts input tokens only, at the price you typed.

Prompt compression has two halves and only one of them is safe. The safe half is removing characters that carry no instruction: double spaces, trailing whitespace, blank-line pile-ups, a rule pasted in twice. That is what the default settings do, and there is no argument against it — nothing was said, so nothing can be lost.

The unsafe half is removing words. "In order to" really does mean "to", and "it is important to note that" really is noise, but the model was tuned on text where those phrases carry emphasis, and a prompt is a program you cannot unit-test by reading it. Every substitution this tool makes is listed above with the exact string it replaced, because the only responsible way to use a compressor is to read what it did.

There is a second cost that never shows up in a token count, and it is the one that catches people: compressing a prompt changes its prefix, and a changed prefix is a cold cache. If you send a 900-token system prompt on every request and it is being cached, shaving 120 tokens off it saves you 120 tokens per request at the cached rate, not the full one — while forcing one full-price write to refill the cache. On a high-traffic endpoint that is still a win within minutes, but it means the honest comparison is against the cached price, not the headline price.

The number worth chasing is not the percentage. It is the monthly figure above, because a 30% saving on a prompt sent twice a day is nothing and a 6% saving on one sent two million times is a salary. Set the request volume to what you actually run before deciding this was worth an afternoon.

Prompt Compression Preview · Multigrid