Prompt Token Reducer
Paste a prompt, pick the cleanup rules, and see the token savings. Everything runs locally in your browser.
How to use it
Paste a system prompt, instruction block, or any text you send to a large language model. Choose which cleanup rules to apply and press Reduce. The tool counts tokens before and after with the open-source gpt-tokenizer library using the o200k_base encoding, which recent OpenAI models use. It also estimates what you'd save at your price per million input tokens and your monthly call volume.
What each rule does
Collapse whitespace squeezes repeated spaces, tabs, and blank lines. Models rarely need them, and they quietly cost tokens. Remove filler phrases drops politeness and hedging like "please," "I would like you to," "basically," and "very," and rewrites "in order to" as "to." Drop duplicate lines removes exact repeated lines, a common leftover from copy-pasted templates. Strip Markdown removes bold markers and headings. Leave it off if your model relies on structure.
FAQ
Is my prompt sent anywhere? No. The tokenizer is bundled with the page and runs on your device. There's no server and no tracking.
Are the counts exact for every model? They're exact for models that use o200k_base. Other providers such as Anthropic and Google use their own tokenizers, so treat these counts as a close estimate for them and check your provider's usage report for billing.
Will removing filler hurt quality? Usually not. Modern models follow direct instructions well, and "please" doesn't buy better answers. Still, always test the reduced prompt on a few real inputs before shipping it. The rules are simple and deterministic, so read the output before you use it.
Why bother saving a few tokens? System prompts are sent with every request. Trimming 50 tokens from a prompt used 100,000 times a month removes 5 million input tokens from your bill.
License: token counting by gpt-tokenizer (MIT).