Cleaning up model output without losing meaning
Four actions cover almost every paste artefact. Knowing when to stop matters as much.
Text copied out of a chat window rarely pastes cleanly into a document. Extra blank lines, a duplicated heading, spaces that used to align something and no longer do — each problem is tiny on its own, and together they turn copy-paste into reformatting. The fix is a handful of targeted actions rather than a blanket reformat.
Paste artefacts come in only a few kinds
Classify the problem and it turns out to be much narrower than it feels:
- Blank-line runs Two or three empty lines between paragraphs, inherited from the chat layout.
- Duplicate lines A heading or conclusion appearing twice, usually from a "summary plus body" structure.
- Doubled spaces Spaces that once aligned a table or an indent, in an environment where that alignment no longer exists.
- Ragged line edges Every pasted line can carry them. Invisible to the eye, poisonous to a diff.
One action per problem
Targeted actions are far safer than a blanket reformat, because you can predict each one:
- Collapse blank lines: reduce runs of empty lines to a single separator, leaving paragraph structure intact.
- Drop duplicate lines: keep first occurrences in order, discard the rest.
- Squeeze spaces: collapse runs of spaces and tabs into one space, nothing more.
- Trim lines: clean both edges of every line without touching the inside.
Each action is explicit and predictable. None of them reinterprets your paragraphs for you.
When to stop
Cleanup has an implicit boundary: it may remove redundant whitespace and repetition. It may not change the text.
The moment an operation has to guess at intent — auto-joining short lines, normalising punctuation, rewriting list levels — it has crossed that line. Ninety percent of the time it looks tidier. On the ninety-first it silently removes a line break you needed.
The test is simple: does this action make the text shorter? An action that only drops whitespace and repetition is safe. One that rewrites content is not.
Count again afterwards
Look at the counters once you are done — characters, lines, tokens. Two reasons: it confirms the cleanup did something, and the change in token count tells you how much noise that paste carried. Next time you copy, you may choose to do it differently. The text cleanup tool keeps all four counts beside the four actions, so the change is visible as you make it.
Keep reading
- Markdown or plain text: choosing a handoff format
Two conversions, one failure mode each.
- Prompt templates that actually work
Most prompt failures are missing constraints.
- Text statistics & cleanup
Count and clean text without leaving the page.
The goal of cleanup is to return text to the shape it should have had, not to make it look tidier. When those two diverge, do less.