Skip to content
WebUtilityHub

Text Cleaner

Tidy up text copied from PDFs, emails, websites or chat apps. Remove extra spaces, blank lines and invisible characters, and see exactly what changed.

Cleaning steps

Line breaks are always normalised to a single standard line break.

Before and after statistics
Statistic Before After Change
Characters 0 0 0
Lines 0 0 0
Spaces and tabs 0 0 0

How to use the Text Cleaner

  1. Paste your text into “Your text”.
  2. Choose the cleaning steps you want. The default settings remove extra spaces, trim each line, collapse blank lines and strip invisible characters.
  3. Check the cleaned version and the before/after statistics.
  4. Click “Copy result” to copy the cleaned text.

Examples

Text pasted from a PDF
Input
  The   quick  brown   fox  



jumps over   the lazy dog.  
Result
The quick brown fox

jumps over the lazy dog.
Default settings.
Repeated punctuation (Fix repeated punctuation on)
Input
Wow!!! Really??? Wait.... ok,, fine
Result
Wow! Really? Wait... ok, fine
A list with blank lines (Remove all empty lines on)
Input
apples

oranges


pears
Result
apples
oranges
pears

Before and after

The table below the tool compares your original text with the cleaned version: total characters, lines, and spaces or tabs. The “Change” column shows how many were removed, so you can check that a cleanup did what you expected before you copy it.

Choosing the right steps

For prose and articles, the defaults are usually right: single spaces, trimmed lines, and one blank line between paragraphs. For lists, turn on Remove all empty lines. For chat messages or social posts written in a hurry, Fix repeated punctuation tidies up “!!!” and “???”. If you need to keep indentation, such as in code or poetry, turn off Remove extra spaces and Trim lines.

After cleaning a list, remove repeated items with Remove Duplicate Lines. To see how many words and characters remain, use the Word Counter.

Common uses

  • Cleaning text copied from PDFs, which often contains double spaces and broken line spacing.
  • Preparing text for a CMS, an email template or a social media post.
  • Removing invisible zero-width characters that break searches, comparisons or code.
  • Tidying lists before importing them into a spreadsheet or another tool.
  • Normalising spacing in translations or documents edited by several people.

Limitations

  • The cleaner does not join lines that a PDF split in the middle of a sentence; that would risk merging separate paragraphs.
  • “Remove extra spaces” also replaces tabs with single spaces, which removes tab-based alignment and indentation.
  • “Fix repeated punctuation” keeps “?!” and three-dot ellipses, but it would also change intentional repetitions such as “!!” in a quote.
  • Invisible characters used by some languages, such as the zero-width non-joiner in Persian, are deliberately kept.

Frequently asked questions

Which spaces does “Remove extra spaces” handle?

Normal spaces, tabs, non-breaking spaces and typographic spaces of different widths. Any run of these inside a line becomes a single normal space. Line breaks are not affected by this step.

What are invisible characters and why remove them?

Characters such as the zero-width space, the word joiner and the byte-order mark take up no space on screen but are still part of the text. They often come from websites, word processors or messaging apps, and can make two identical-looking words compare as different. Emoji sequences that rely on invisible joiners, such as family emoji, are kept intact.

What is the difference between “Collapse empty lines” and “Remove all empty lines”?

Collapsing keeps paragraphs separated by exactly one blank line and removes blank lines at the start and end. Removing all empty lines joins every non-empty line directly, which is useful for lists.

What happens to line breaks?

Line breaks from Windows, classic Mac and Unix systems are all converted to standard line breaks, so the result behaves the same everywhere.

Remove repeated lines from a list while keeping the original order, with case and whitespace options.

Text

Count words, characters, sentences, paragraphs and lines, with an estimated reading time.

Text

Convert text to UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case or kebab-case.

Text