Skip to content

Prompt Optimizer

Cut the tokens out of a prompt without cutting the meaning — the same instruction, fewer tokens, a smaller bill.

Two ways to shorten a prompt

Quick clean-up
Deterministic. Instant. Never leaves the page.

A fixed set of meaning-preserving edits: filler openers removed, long connectives swapped for short ones — in order to becomes to — and repeated whitespace collapsed.

It runs in your browser, so nothing is transmitted, there is no API key and no cost. The same input always produces the same output.

It deliberately never touches fenced code blocks, inline code, or URLs, because a “shorter” code sample is a broken one.

Smart rewrite (AI)
Goes further. Reads better. Sent to Google.

Restructures rather than substitutes: merges redundant instructions, drops sentences that repeat an earlier one, and tightens phrasing a rule table cannot reach.

Your prompt is sent to Google’s Gemini API to do this. That is the tradeoff, and it is the whole tradeoff — if the text is confidential, use the quick clean-up instead.

It is also non-deterministic. The same prompt can come back slightly differently, so read the result before you ship it.

When to use which

  • Anything sensitive — quick clean-up, always. It is the only one of the two where the text stays on your machine.
  • A prompt you send constantly — a system prompt, a template — is worth the AI rewrite. You pay the rewrite once and keep the saving on every call afterwards.
  • A one-off question — neither. The saving on a single request is a fraction of a cent, and the time you spend optimising it costs more than the tokens do.

A worked example

The figures below are produced at build time by running the actual clean-up and the actual tokenizer over the prompt shown, so they match what the tool does rather than describing it.

Before130 tokens
I was just wondering if you could help me to write a product description for our new wireless headphones.

In order to make sure the description is effective, please kindly follow the guidelines below. Due to the fact that we sell to a large number of different customer segments, the tone needs to work for all of them.

Guidelines:
- In the event that you mention the battery life, please make sure to say it is 40 hours.
- At this point in time we are not able to claim waterproofing, only water resistance.
- In order to keep things readable, please use short sentences.

Thank you very much for your help with this.
After quick clean-up105 tokens
Please help me to write a product description for our new wireless headphones.

To make sure the description is effective, please follow the guidelines below. Because we sell to many different customer segments, the tone needs to work for all of them.

Guidelines:
- If you mention the battery life, please make sure to say it is 40 hours.
- Now we are not able to claim waterproofing, only water resistance.
- To keep things readable, please use short sentences.

Thank you very much for your help with this.
Measured token counts and input cost on GPT-4o
Tokens saved25 of 130
Input cost on GPT-4o$0.000325$0.000263
What that saves, by how often you send it
One request$0.0000625
10,000 requests$0.62
1,000,000 requests$62.50

Approximate, and specific to this prompt — how much a clean-up recovers depends entirely on how padded the original was. Some prompts are already tight and the tool will barely move them. Note too that the clean-up is mechanical: it turned “at this point in time” into “now”, which is shorter and very slightly stilted. That is the seam where the AI rewrite earns its privacy cost.

Why a few tokens matter

Because you rarely send a prompt once. A system prompt is attached to every call, and in a chat feature the whole history is resent on every turn — so a saving you make once is banked on every request that follows, and the padding you leave in is billed the same way.

That is also the reason optimising a one-off question is a waste of time, and optimising a template is not. The two posts below work through the arithmetic:

Try it on your own prompt

Paste it into the calculator and the optimizer sits directly under the price, with the saving measured against the model you are actually using.

Try it on your own prompt