AI & LLM

Context Window Trimmer

Trim a conversation to fit a context window by several strategies.

  • Draft kept in this tabYour draft is kept in this tab's session storage and cleared when the tab closes.
  • Runs in your browserProcessing happens in this page. No application server receives your input.
Budget 8,000 ยท o200k_base

Conversation JSON

Trimmed conversation

Messages (0)

#RoleContent previewTokensStatus
Paste a valid JSON conversation to inspect per-message token counts.

Budget & accounting summary

Content tokens
โ€”
Message overhead
โ€”
Budget
8,000
Dropped
โ€”
Encoding
o200k_base
Estimated input cost
โ€”
Prices as of
2026-02-01

What this tool does

Trims a multi-turn conversation to fit a model's context budget using one of four deterministic strategies (tail, head-tail, middle-out, or drop-tools), shows which messages survived and which were dropped, and reports the exact content count separately from the approximate per-message role envelope allowance.

Limits

It does not summarize. Dropping is the only operation, and a dropped run is replaced with a marker that counts what it removed: summarizing needs a model, and no tool here calls one. The message overhead is an approximation of the provider's role envelope and is shown as its own line, never folded into the exact count. Tool and function definitions attached to a request are not counted; paste them into T51 separately. Trimming to fit is not the same as trimming well: the strategy that keeps the right context is a judgement about your conversation, not about your token budget.

Scope: this covers the page itself. Your browser, operating system, clipboard, downloads, extensions, and crash recovery may keep copies, and a compromised site origin would not be protected.