Converters tool

Text Cleaner

Clean up messy text in one step. Fix text copied from PDFs, remove extra spaces and empty lines, delete duplicates and more.

Input
Result
Converts as you type.

How to clean up text

  1. Paste your text into the Input box.
  2. Tick the clean-up options you need. The result updates instantly, and the bar under the boxes shows how much was removed.
  3. Press Copy result or Download. Press Edit result to keep cleaning the cleaned text.

What each option does

  • Remove extra spaces: turns double and triple spaces into one, and removes spaces before commas and periods.
  • Trim spaces at line start and end: removes indentation and trailing spaces from every line.
  • Fix broken lines: text copied from a PDF or a plain-text email often has a line break every 60–80 characters. This joins those lines back into flowing paragraphs, keeps the blank lines between paragraphs, and mends words split with a hyphen across two lines.
  • Remove all line breaks: turns everything into a single line, which is handy for form fields and spreadsheets.
  • Remove empty lines and Remove duplicate lines: tidy up lists. Duplicates are matched regardless of capitals and surrounding spaces, and the first copy is kept.
  • Sort lines A–Z: sorts alphabetically, with numbers in natural order (2 before 10).
  • Straight quotes and plain dashes: replaces curly quotes, em dashes, ellipsis characters and non-breaking spaces with plain keyboard characters. Use this before pasting text into code, CSV files or systems that garble special characters.
  • Strip HTML tags: removes tags like <p> and <br> and keeps the readable text.
  • Remove emoji: deletes emoji and pictographs.

Options are applied in a fixed order (HTML, quotes, line fixes, spaces, empty lines, duplicates, sorting, emoji), so the result is the same whichever order you tick them in.

Read our guide How to fix text copied from a PDF for more tips.

Frequently asked questions

Will it change my words?

No. Only spacing, line breaks and the characters you choose to remove are changed. Spelling and wording stay exactly as you wrote them.

How do I remove duplicates from a list?

Paste the list with one item per line and tick Remove duplicate lines. To compare two separate lists instead, use Compare Two Lists.

Is my text uploaded?

No. Cleaning happens in your browser and your text stays on your device.

Learn more

More free text tools