Skip to content

Tool 03 / Clean up

Text that behaves after it is pasted.

Excel, Word, PDFs, and web pages all bring their own idea of whitespace. Clean it up without retyping a paragraph or trusting another upload form.

  • Free to use
  • Four presets
  • Runs locally
Live workbenchEveryday clean
Presets
Whitespace
Characters & markup

Cleaning is non-destructive: the original stays in the left box, and every option only changes the copy on the right.

Clean result
20 chars removed13 words5 lines out95 chars outNever uploaded

What it does

Copying text is lossy in ways you only notice later. A PDF adds a line break in the middle of a sentence. A web page brings non-breaking spaces and invisible joiners. A spreadsheet pads cells with tabs and leaves empty rows behind. None of it is visible until the text is pasted somewhere that cares.

This cleaner runs a series of small, opt-in transformations. You can trim the edges of every line, collapse repeated spaces, remove blank rows, replace non-breaking spaces, strip zero-width characters, straighten curly quotes, or throw away HTML markup. The original stays in the left pane and the result updates in the right, so you can turn an option on, look at the difference, and turn it off again.

The order of operations is fixed and sensible: invisible characters are Normalized first, whitespace is cleaned next, and line joining happens last. That matters when a line break is the thing you are trying to remove.

How to use it

  1. Paste the text into Messy text.
  2. Pick the closest preset. It sets a group of options in one click; switching a preset never changes your input.
  3. Adjust individual options. Watch the character count at the bottom: a large drop usually means something was removed that you wanted to keep.
  4. Read the result. If the text is prose, check that sentences still end where they should; if it is data, check that columns survived.
  5. Copy or download the cleaned text.

Presets

Everyday clean
Trims line ends, collapses repeated spaces, removes invisible characters and non-breaking spaces, and keeps at most one blank line. The right default for prose copied from almost anywhere.
Excel / CSV
Trims each line, removes blank rows, and normalizes invisible characters. It does not collapse spaces or convert tabs, so cell contents and column alignment are left intact.
From the web
Strips HTML tags and common entities, straightens curly quotes, collapses spaces, and removes blank lines. Intended for prose, not for pages where the markup itself matters.
One paragraph
Joins every line into a single paragraph, then trims and collapses. The fastest fix for a PDF that broke a sentence every twelve words — provided the text really is one paragraph and not a list.

Every option

The checkboxes are independent, and every one is reversible. These are the details that are easy to miss:

  • Trim spaces at line ends removes whitespace at the start and end of each line, including tabs. It does not touch spaces between words.
  • Collapse repeated spaces turns two or more spaces into one. It does not touch tabs, which is why it is safe to combine with tab-separated data only if you know the tabs are not meaningful.
  • Convert tabs to single spaces replaces every tab character. This is destructive for TSV files and for code that uses tabs for indentation; leave it off there.
  • Join all lines into one paragraph replaces runs of line breaks with a single space and trims the result. It will merge headings and list items too, so use it only on continuous prose.
  • Blank lines has three settings: keep them, keep at most one, or remove them all. Removing blank lines is not the same as joining lines; the surviving lines keep their breaks.
  • Remove zero-width and invisible characters targets the zero-width space, zero-width joiner and non-joiner, word joiner, and byte-order mark. These are the usual suspects when two strings look identical but do not compare equal.
  • Replace non-breaking spaces converts U+00A0 to an ordinary space. Web pages and Word documents use them liberally to prevent line breaks, and they are a common reason a search fails later.
  • Straighten curly quotes converts “smart” double and single quotes to straight ASCII quotes. Useful for prose destined for plain-text systems; not for prose where typography matters, and never for code.
  • Strip HTML tags removes tags, script and style blocks, comments, and a short list of common entities. Block endings and <br> become line breaks. See the limits below.
  • Normalize Windows line endings converts CRLF and lone CR to LF. Useful before comparing text or committing it to a system that expects Unix endings.

Examples

A paragraph pasted from Word
From the web preset · quotes on

Before

“The  launch   is on Friday.”
We’re   ready,  and the   page is live.

After

"The launch is on Friday."
We're ready, and the page is live.

The smart quotes become straight quotes, the runs of spaces collapse, and the invisible characters that Word leaves behind are removed. The line break stays because the text is two lines.

A single column out of Excel
Excel / CSV preset

Before

SKU-001
SKU-002

  SKU-003  
SKU-004

After

SKU-001
SKU-002
SKU-003
SKU-004

Blank rows disappear and the edges are trimmed. Spaces inside a cell are untouched, which is the point: a product name such as Blue Widget keeps its double space rather than being silently rewritten.

HTML from a copied page
Strip HTML on

Before

<p>Hello <strong>world</strong>.</p>
<p>Second paragraph<br>with a break.</p>

After

Hello world.
Second paragraph
with a break.

Paragraph endings and <br> become line breaks; the inline tags simply vanish. Tables and nested lists do not survive well — see the limits.

Limits worth knowing

  • HTML stripping is regex-based. It is not a browser-grade parser. Broken markup, unusual entities, and deeply nested tables can leave text behind or lose structure. Check the output before publishing.
  • Whitespace cleaning can break code. Indentation is whitespace. Running “collapse repeated spaces” or “tabs to spaces” over source code will change its meaning.
  • Joining lines is not reversible from the output. The original remains in the left pane, but the cleaned text no longer knows where the breaks were.
  • Straight quotes are a prose tool. They will corrupt code, JSON, and anything that distinguishes curly from straight quotation marks.
  • No accent folding or spellcheck. This page cleans characters and whitespace; it does not correct spelling, grammar, or Unicode normalization beyond the listed steps. For duplicates, use Remove Duplicate Lines.
  • Nothing is stored. A refresh starts over, so copy the result before you leave.

Page updated

Questions, answered

Why does text pasted from Excel look wrong?

Spreadsheet cells often carry tabs, trailing spaces, non-breaking spaces, and empty rows. The Excel / CSV preset trims the edges of each line and removes blank rows, while deliberately leaving spaces and tabs inside a line alone so columns and values are not merged.

Does it remove line breaks?

Only if you ask it to. “Join all lines into one paragraph” replaces line breaks with spaces, which is useful for text pulled out of a PDF. “Remove blank lines” removes empty lines but keeps the remaining breaks.

Can it strip HTML from copied web pages?

Yes, with a caveat. The strip step removes tags, script and style blocks, and converts block endings and <br> into line breaks. It is a regex-based cleaner, not a full HTML parser, so badly broken markup or unusual entities can leave residue. Always check the result.

Is it safe to use on CSV files or code?

Be careful. Collapsing spaces can destroy code indentation, converting tabs to spaces can break tab-separated files, and straightening quotes changes string literals. For machine-readable data, use the Excel / CSV preset and leave the character-level options off.

What are zero-width characters, and why remove them?

They are invisible Unicode code points such as the zero-width space, word joiner, and byte-order mark. They arrive from PDFs, web pages, and some copy tools, and can make an otherwise identical string fail a comparison or a database lookup. Removing them is safe for ordinary prose.

Can I undo a clean?

The original text stays in the left box and the result is a separate preview, so nothing is destroyed. Copy or download the result before clearing the page, because the site does not store anything.

All tools →