UtilityPilot.Find a tool

Text & Lists

Text Cleaner

Clean up text copied from documents, emails or websites. Remove extra spaces, trim line edges and repair hard wraps with explicit options, while keeping the original paste beside the cleaned result.

Processed in your browserPrivacy details ↗

1 MiB per input

Adjust your options

No sign-up. No upload.

What is a text cleaner?

A text cleaner repairs unwanted spacing and line breaks in plain text. A paste from a PDF can contain a newline after every visual row; a copied heading can contain repeated or non-breaking spaces. This tool lets you decide which of those characters should change before you reuse the text.

Cleanup does not rewrite sentences, fix grammar, repair OCR errors or recover the reading order of a document. It also does not strip HTML tags from source code. Pasting into the plain-text input does not retain fonts and colors, but literal markup such as <b>word</b> remains text.

How to clean text online

  1. Paste the text into Your input. Keep the original source available.
  2. Start with the defaults: replace non-breaking spaces, trim line edges and collapse repeated spaces. Line breaks are kept.
  3. Select other operations only where they match the problem, such as replacing tabs or joining hard wraps.
  4. Select Clean text. Inspect the output and the change counts for the selected operations.
  5. Copy result or Download. If structure was lost, change the options and rerun from the unchanged input.

Test a passage containing a heading, paragraph break and any meaningful indentation before processing a longer document. Up to 1 MiB of input is accepted, and cleanup runs locally in your browser.

Remove whitespace: what each option changes

Non-breaking spaces and tabs

Replace non-breaking spaces converts U+00A0 to an ordinary space. This is enabled by default. Replace tabs with spaces converts each tab into one ordinary space, rather than reproducing its visual width; it starts off. Do not replace tabs in a tab-delimited table if they still separate fields.

Leading, trailing and repeated spaces

Trim line edges removes ordinary spaces and tabs from the start and end of each line. Collapse repeated spaces replaces runs of two or more ordinary spaces with one. Both start enabled. They do not implement a universal removal of every Unicode spacing character.

Collapse repeated spaces does not delete the single spaces between words. To remove ordinary spaces from text entirely, use literal Find and Replace with a space as Find and an empty replacement. Treat that as a different operation: joining “part one” into “partone” changes the text’s structure.

Optional zero-width removal

Remove zero-width characters deletes U+200B, U+200C, U+200D and U+FEFF. It starts off because joiners and non-joiners can affect scripts and emoji. An invisible character is not automatically unwanted. Use this option only when you have identified those characters as the source of a problem.

Remove blank lines or collapse extra blank lines?

The Collapse extra blank lines option reduces a run of three or more newline characters to two. In plain text, that keeps one empty line between two paragraphs. It is a way to reduce excessive paragraph spacing, not a complete remove-empty-lines command.

For example, A\n\n\nB becomes A\n\nB. Here \n stands for an actual line break. A single blank separator between A and B remains. Lines containing ordinary spaces or tabs can become empty first if Trim line edges is enabled; lines containing other characters may not.

Join all lines removes runs of line breaks by replacing each run with a space. That also removes the separation between nonblank lines, so it is not a way to delete blank entries while keeping a list intact. To inspect how many physical lines remain, use the line count in Word Counter.

Keep line breaks or repair hard wraps

Keep line breaks preserves the line structure after normalizing line endings. This is the default and is usually appropriate for addresses, poetry, source code and one-item-per-line lists.

Join hard wraps; keep paragraphs replaces a single newline between nonempty lines with a space. Two or more consecutive newline characters continue to separate paragraphs. It cannot infer that a heading or address deserves its own line if there is no blank line marking that boundary.

Join all lines replaces every consecutive run of newlines with one space. Use it only when one continuous text block is the desired result. For a simple list that needs commas rather than spaces, follow the comma-separated list workflow.

Cleaning text examples

Input

  A  useful idea  

Result

A useful idea

The default options trim the edges and collapse the two spaces between A and useful. The words remain unchanged.

Input

A useful idea
wrapped across lines.

A new paragraph.

Result

A useful idea wrapped across lines.

A new paragraph.

The second example uses Join hard wraps; keep paragraphs. The single wrap is joined while the blank paragraph separator remains. This example keeps two paragraph blocks before and after cleaning; verify the structure with the paragraph counter. If the original has no blank separators, this setting cannot reconstruct paragraphs from meaning. See the copied-text cleanup guide for a longer workflow.

How the text cleaner applies its rules

Operations run in this order: normalize CRLF and CR to LF; replace selected non-breaking spaces; replace selected tabs; trim line edges; collapse repeated ordinary spaces; collapse extra blank lines; join selected line breaks; remove selected zero-width characters.

Order matters. Replacing tabs first can create repeated spaces that the later collapse step removes. Joining lines happens after space collapsing, so it can introduce extra spaces if trimming was disabled or the source had unusual boundaries. Review the final output rather than assuming every sequence of options produces the same result.

The change counts report replacement matches, not characters removed. Trimming a run of five edge spaces is one match; zero-width removal counts the matched characters individually. A normalized line ending is also a change even when the result looks identical on screen.

Text formatter: format text online without changing the wording

As a plain-text formatter, this page handles spacing and line structure. It does not add fonts, bullets, numbered lists, indentation styles or rich document formatting. Use it to prepare copied paragraphs for an editor, normalize accidental spacing in labels, or tidy a simple list before another operation.

For capitalization, use the Text Case Converter. For repeated entries, use Remove Duplicate Lines. For specific unwanted strings, use Find and Replace Text. These operations solve different problems and should not be applied automatically to every paste.

Common text-cleaning problems

Tabs and leading spaces may encode columns or indentation; joining hard wraps can flatten an address; and zero-width joiners can change how an emoji or word is displayed. Select only the operations that fit the material. Check the result with Text Diff if you need to see what changed, with whitespace normalization disabled so the cleanup edits remain visible.

A PDF may copy hyphenated words or text in the wrong column order. This cleaner does not know whether a hyphen belongs to a word or where the next column begins. Correct those issues explicitly rather than removing every hyphen or joining every line.

Processing and privacy

Text Cleaner rewrites the pasted text in page memory; the original and cleaned versions are not sent to a server. Input stays in browser memory until you reset or leave the page. Copy and download run only when you choose them. No tool input is sent to a processing service. Website pages and scripts still make ordinary hosting requests; the privacy policy separates those from tool processing.

Frequently asked questions

Can this remove all blank lines and preserve the other lines?

There is no dedicated option for that operation. Collapse extra blank lines keeps one empty separator; Join all lines joins the entire text. Choose only if that result matches your task.

Does this remove unwanted formatting from a document?

It works on the plain text you paste and changes selected whitespace. It does not edit a Word/PDF file, strip literal HTML markup or preserve rich document styling.

Why are some invisible characters still present?

Each option targets specific characters. The cleaner does not delete every invisible Unicode character because some are meaningful to scripts, emoji or formatting.

How this tool was checked

Text Cleaner was checked with non-breaking spaces, tabs, hard-wrapped paragraphs, zero-width joiners, CRLF input and option combinations where one cleanup step creates work for the next. See the testing method or report a failure.