Text Cleaner

Clean up messy text: trim each line, collapse repeated spaces, remove empty lines or flatten line breaks.

The Text Cleaner removes unwanted spaces and line breaks from a text, with four combinable operations: trim leading/trailing space from each line, collapse repeated spaces, remove empty lines, and remove line breaks entirely.

Your files are processed locally in your browser and are not uploaded.

Cleaning options

Result

—

How to use Text Cleaner

  1. 1

    Paste the text

  2. 2

    Check the cleaning options you want

    You can combine more than one.

  3. 3

    Copy the cleaned result

What each option does

Trimming lines removes extra whitespace at the start and end of each line, without touching the content. Collapsing spaces turns runs of several spaces into a single one. Removing empty lines eliminates blank lines between paragraphs. Removing line breaks joins everything into a single continuous line, separated by spaces.

When should you use this tool?

  • Text pasted from a PDF

    Clean up odd line breaks that appear when copying text from a PDF.

  • Imported data

    Standardize the spacing of text coming from a spreadsheet or other system.

  • Content prep

    Remove extra blank lines before publishing a text.