Prompt token trimmer
Every token in a prompt is paid for on every single call — so a bloated system prompt quietly taxes your whole application. This tool shortens a prompt toward a target token budget using deterministic rules that strip the parts models don’t need: politeness filler, verbose preambles, and redundant phrasing. A live token estimate shows how far each edit moves you toward the budget.
What makes prompts verbose
Prompts accumulate length in several predictable ways. Understanding the patterns makes it easier to decide how aggressively to trim.
Politeness openers arrive from the habit of addressing an LLM the way you might address a person. “Could you please kindly help me with the following task?” contains four filler tokens — “could you please,” “kindly,” “help me with the following task” — where the imperative “do the following” is shorter and equally effective.
Verbose preambles expand what could be one sentence into three. “I would like you to analyze the provided text and then give me a comprehensive summary of the key points contained within it” is the wordy form of “Summarize the key points.”
Redundant intensifiers add length without adding precision. “Always make absolutely certain to never ever” can almost always be simplified to “always” or “never.”
Hedging language signals uncertainty about whether an instruction applies. “If applicable, you may optionally include…” usually resolves to either “include…” or removing the instruction entirely.
Repeated context happens when instructions reference the same background multiple times — once at the start and again near the relevant rule. Each repetition adds tokens without adding information.
How it works
The trimmer applies a sequence of safe transformations:
- removes politeness filler (“please”, “kindly”, “thank you”),
- cuts common verbose preambles (“I would like you to”, “your task is to”) down to the imperative,
- collapses redundant intensifiers and duplicate whitespace,
- at higher aggressiveness, replaces wordy phrases with shorter equivalents (“in order to” → “to”, “due to the fact that” → “because”).
Token counts are estimated with the standard ~4-characters-per-token heuristic so you can compare before and after at a glance. Nothing leaves your browser. If a rule cuts something you need, just edit it back in the output before copying.
Tips and notes
Start at the light level and only escalate if you are still over budget — aggressive collapsing can occasionally shave nuance you wanted. Trimming pays off most on system prompts and templates that run on every request, where each saved token multiplies across thousands of calls. Pair this with the LLM cost calculator to turn the token saving into a money figure, and always test the trimmed prompt on real inputs: shorter is only better if the output quality holds.