Skip to content

Prompt Truncator

Fit a prompt to a token budget by one of four strategies, and see exactly which text was removed.

Estimated tokens kept
~119

96 tokens removed — 44.5% of the prompt. Kept the opening. Instructions at the top survive; anything you appended last is gone.

Original
932 chars · ~215 tokens (est.)
Budget
120 tokens
Marker cost
~5 tokens
Kept
516 chars · ~119 tokens
Removed
416 chars · ~96 tokens
Removed share
44.5%
Headroom left
1 tokens
What this assumes: token counts here are estimates from a character-class model that runs in your browser — roughly 3.7 Latin letters, 3 digits or 1.7 punctuation characters per token, one token per CJK character, whitespace free. No real tokenizer ships with this page, because one is megabytes of vocabulary and nothing here fetches anything. The authoritative count is the usage object on an actual API response: that is what you are billed on, and it includes chat-template wrapping this model cannot see. The cut point is found by binary search on the estimate, then walked back to the nearest space so a word is never halved — which means the result is normally a few tokens under the budget rather than exactly on it. Because the budget is enforced against an estimate and the provider counts differently, leave a margin of a few percent before sending. Nothing here reserves room for the model’s reply: the context window has to hold your prompt and the output, and this tool only sizes the prompt.

What survives

You are a support assistant for an online bookshop. Answer only from the policy notes below. If the notes do not cover the question, say so and offer to escalate.

Policy notes:
Refunds are available for 30 days from delivery on unopened items. Opened items may be exchanged but not refunded. Damaged items are replaced at our cost regardless of when they are reported, provided a photograph is attached.

Shipping is free above the free-shipping threshold and charged at a flat rate below it. Delivery estimates are

Removed from the end · 416 chars · ~96 tokens

 working days and exclude the day of dispatch. Signed-for delivery is available at checkout.

Gift orders may be returned by the recipient without the purchaser being notified. Gift receipts do not show prices.

Subscriptions renew on the anniversary of the first order and may be paused twice per year for up to three months each time.

Answer in at most three sentences. Never invent a policy. Never quote a price.

Read the second box, not the first

Every truncator produces a shorter prompt. The question that decides whether truncation was a good idea is what left, and that is why the removed text is shown here in full rather than as a token count. Nine times out of ten the surprise is not the volume — it is that the one constraint the answer depended on was in the part that went.

The four strategies fail in different, predictable ways. Keeping the start preserves your instructions and throws away the user’s actual question, which produces confident answers to something nobody asked. Keeping the end does the reverse: the question survives and the rules do not, so the model stops following a format it was never told about. Keeping both ends is the usual compromise and the one that hides its damage best, because the output still looks well-formed while the evidence it needed has quietly gone from the middle. Dropping whole paragraphs loses more text for the same budget but never leaves a half-sentence, which matters when the content is structured.

Two things this cannot tell you. It cannot say whether the model will notice the gap — inserting a marker at the cut makes it more likely to say “I don’t have that information” instead of inventing it, which is usually what you want, and costs a handful of tokens. And it cannot rank the material by importance. If you find yourself truncating routinely, the fix is not a better cut point; it is retrieval, so that only the relevant part is ever in the prompt.

Prompt Truncator · Multigrid