Prompt Optimizer
Tighten a prompt with named, reversible rules, then see the token and cost saving. Deterministic — no model call, nothing rewritten silently.
Your prompt
0 tokensOptimised
0 tokensYou are a helpful AI assistant. Review the customer support ticket below and extract the key details.
I think you should probably identify the customer's main issue. also identify the product they are using.
determine the urgency level.
be very thorough to make sure nothing is missed. Just return the results as JSON in the following format:
```json
{"issue": "string", "product": "string", "urgency": "low | medium | high"}
```
in advance!Rules
6 of 9 onRules marked review are judgement calls and are off by default. Everything inside a ``` fence or `inline code` is never touched — 86 characters protected here.
What the saving is worth
GPT-4oLoading the o200k_base vocabulary — 965.7 KB, once per browser.
Tokens saved
0
no baseline
Cost / month, before
$1,500
Cost / month, after
$1,500
Saving / month
$0.00
0.0% of the bill
The saving is priced against the whole bill, output included. A shorter prompt does not change output cost, so the percentage saved is always smaller than the percentage of the prompt removed.
What changed
8 edits across 5 rulesYou are a helpful AI assistant. As an AI language model, I want you to please reviewReview the customer support ticket below and extract the key details.
I think you should probably identify the customer's main issue. Please also identify the product they are using.
It is important that you determine the urgency level.
It is important that you
determine the urgency level.
Please be very thorough in order to make sure nothing is missed. Just return the results as JSON in the following format:
```json
{"issue": "string", "product": "string", "urgency": "low | medium | high"}
```
Thank you very much in advance!
- Model preamble1 edit“As an AI language model,”
- Filler openers1 edit“. I want you to please r”
- Politeness padding3 edits“Thank you very much” “Please”
- Verbose phrases2 edits“in order to” “It is important that you”
- Repeated lines1 edit“It is important that you determine the urgency level.”
Optimised and counted in your browser — no prompt is uploaded, and no model is called. To compare two prompts you wrote yourself, use the Prompt Diff Viewer; to strip invisible characters and smart quotes, use the Prompt Cleaner.
About the Prompt Optimizer
This prompt optimizer is deterministic, not generative. It does not send your prompt to a model and ask for a shorter one — every edit comes from a named rule applied to the text, so the same input always produces the same output, each change is attributed to the rule that made it, and any rule you disagree with can be switched off. That is a deliberate design choice, and it is the one worth understanding before using any tool with this name.
The alternative — asking a model to rewrite your prompt — has a failure mode that matters: it can quietly change what the prompt asks for. A prompt that comes back 30% shorter and subtly different is worse than the one you started with, because the difference will not be visible until output quality drifts. A rule that removes the word "please" cannot do that. A rewrite can.
The saving is measured rather than claimed. The token delta is computed with the same tokenizer as the token counter, and the cost impact is priced against your actual request volume — input and output together, not input alone, because a prompt is billed on every call and the saving compounds while the output cost does not change.
Fenced code blocks and inline code are never touched. Prompts carry JSON samples, few-shot examples and code the model is meant to reproduce exactly; stripping a word out of one of those would corrupt the part of the prompt that most needs to survive intact.
- Nine named rules, each individually toggleable, with every applied edit attributed and counted
- Safe rules on by default; judgement-call rules (hedges, intensifiers, repeated sentences) marked and opt-in
- Token delta computed with a real BPE tokenizer, not a characters-÷-4 estimate
- Cost impact priced against your request volume, across input and output together
- Word-level diff so you can read exactly what changed before accepting it
- Code fences and inline code protected from every rule
- Idempotent — running the result through again changes nothing further
How to use it
- Paste the prompt you want to tighten. A system prompt or a long instruction block gives the clearest result.
- Leave the safe rules on. They remove padding that cannot change what you are asking for.
- Turn on the review rules if you want them — hedges and intensifiers are usually worth removing, but they are judgement calls, so they are off by default.
- Read the diff. This is the step that matters: the tool shows you what it changed so you can reject anything you disagree with.
- Set your request volume to see what the saving is actually worth per month.
- Copy the optimised prompt, or switch a rule off and copy a different version.
Real-world use cases
Prompt engineers
Strip padding and hedges out of a system prompt with every change attributed, then review the diff and reject anything that looks load-bearing rather than trusting a black-box rewrite.
AI product & engineering leads
Estimate the monthly saving from tightening a high-volume prompt before investing time in it, so the cleanup is prioritised against its actual payoff.
Backend & platform engineers
Run a deterministic pass over a prompt template during a refactor, confident the same input always produces the same output — useful when the change needs to be reviewable in a diff.
Technical writers documenting prompts
Clean up filler language in example prompts destined for documentation, without a generative rewrite risking a subtle change in what the example actually demonstrates.
QA & prompt reviewers
Use the rule-by-rule diff as a checklist when reviewing a teammate's prompt for unnecessary verbosity, pointing at specific named issues instead of a vague "this could be tighter."
Examples
A filler opener becomes an instruction
I want you to summarise the article below.
Summarise the article below.
The verb is promoted and re-capitalised. "I want you to" tells the model nothing it does not already know from being sent a prompt.
An interrogative becomes an imperative
Could you please list the main themes?
List the main themes.
The question mark goes too. Left as a question, "could you list..." is grammatically a yes/no question, and a model may answer "Yes, I can" instead of listing anything.
Verbose phrases, same meaning
Read it in order to answer, due to the fact that context matters.
Read it to answer, because context matters.
Six tokens shorter with no change in meaning. These substitutions are fixed, not inferred.
Code is left exactly alone
Extract the fields.
```json
{"note": "please keep this very exact"}
```Extract the fields.
```json
{"note": "please keep this very exact"}
```"please" and "very" both survive inside the fence. Outside it, both would have been removed.
Common errors
| Message | Cause | Fix |
|---|---|---|
| The optimised prompt gives worse results than the original | A review rule removed something that was load-bearing. Hedges in particular sometimes carry real instruction — "just return the JSON" means something. | Switch off the rule named in the change list and re-run. This is why every edit is attributed rather than presented as one rewrite. |
| Nothing changed | The prompt is already tight, or the padding it contains is inside a code fence, which is protected. | That is a real result. The rules only remove text they can name; if none of them matched, there is nothing here to remove. |
| The token saving looks small | Padding is a small share of a long prompt. The saving is per request, though, so it compounds with volume rather than with prompt length. | Set your monthly request count. A 40-token saving on a prompt sent a million times is a different number from a 40-token saving. |
| The cost saving is smaller than the token saving suggests | The bill includes output tokens, which this does not change, and output is usually priced several times higher than input. | That is the honest figure. Quoting the saving as a share of input alone would overstate it, sometimes by a factor of five or more. |
| A rule removed a word from something the model must reproduce | The text was not fenced. Only ``` blocks and `inline code` are protected. | Fence it. That is also better prompt design — a model reproduces a fenced block far more reliably than loose text. |
Frequently asked questions
›Does this send my prompt to an AI model?
No. Nothing leaves your browser, and there is no model call at any point. Every change comes from a rule applied to the text locally, which is why the output is identical every time you run it and why each edit can be traced to a specific rule.
›Why not use an LLM to rewrite the prompt properly?
Because a rewrite can change what the prompt asks for without saying so. A shorter prompt that subtly means something else is worse than the original, and the difference is invisible until output quality drifts. It would also add a cost per request and require sending your prompt — often a proprietary one — to a third party. A deterministic tool that removes provable padding is a smaller promise, honestly kept.
›Will a shorter prompt give worse results?
Usually not, and often the reverse. Politeness padding and hedges add nothing a model weighs, and hedged instructions are followed less reliably than direct ones. But this is why the diff is the main output rather than a footnote — check what changed, and switch off any rule you disagree with.
›How is the token count calculated?
With the same BPE tokenizer as the token counter on this site, running locally. For models whose vocabulary is not public, the count is an estimate derived from a calibrated basis encoding and is labelled as such, rather than being presented as exact.
›Why does the cost saving use output tokens I did not change?
Because that is your bill. A prompt that is 15% shorter on an output-heavy workload might be a 2.5% smaller bill. Quoting the saving against input alone would overstate it several times over, and someone might reject a clearer prompt on the strength of a number that was never real.
›Is it safe to run this on a prompt containing code or JSON?
Yes, provided the code is fenced with ``` or wrapped in `backticks`. Everything inside a fence is held back before any rule runs and restored afterwards, so few-shot examples and JSON samples come out byte-identical.
›Can I run it twice for more savings?
There is nothing to gain — the rules are idempotent, so running the output through again produces the same text. That is asserted by a test rather than assumed.
›Which rules are on by default, and which require opting in?
Rules that only remove text with no possible bearing on meaning — filler openers, verbose stock phrases, redundant whitespace — are on by default. Rules that make a judgement call, like removing hedges ("just", "simply") or intensifiers ("very", "really"), are off by default and shown as available to enable, because occasionally that word is doing real work and only you can judge that for your specific prompt.
Last updated