Skip to main content
Text & Writing Tools

Remove Extra Spaces & Line Breaks

Clean up text pasted from PDFs and emails: collapse double spaces, trim lines, join broken lines into paragraphs and remove blank lines.

Paste messy text and choose how to treat line breaks - the clean version updates as you change options.

Text from PDFs sometimes hides special spaces; the non-breaking space option turns those into normal spaces too.

What Does This Tool Do?

Text copied from PDFs, emails and some websites arrives broken: a line break at the end of every line, double spaces between words, tabs and blank lines everywhere. This tool cleans it up. It can join broken lines back into paragraphs, collapse repeated spaces, trim the start and end of lines, remove blank lines, or put everything on one line.

Common Problems It Fixes

  • A paragraph from a PDF that breaks in the middle of every sentence.
  • Double spaces after full stops and between words.
  • Several empty lines between paragraphs.
  • Non-breaking spaces and tabs that stop text from wrapping properly.

How to Use It

  1. Paste the messy text.
  2. Choose what to do with line breaks - Keep paragraphs, join broken lines suits most PDF text.
  3. Tick or untick the spacing options. The clean text updates as you go.
  4. Copy the result.

Example

A paragraph copied from a PDF with a break after "copied", "line" and "place", double and triple spaces, four blank lines and an indented second paragraph becomes two clean paragraphs: This paragraph was copied from a PDF, so every line breaks in the wrong place. and The second paragraph has extra spaces too. - 11 characters shorter than before.

Hyphenated Line Ends

Printed documents often split long words with a hyphen at the end of a line, such as "infor-" and "mation". Tick Re-join words split with a hyphen to put them back together. It only joins when the next line starts with a lowercase letter, so real hyphenated names are less likely to be affected.

Limitations

The tool cannot tell a line break that ends a short line on purpose - in an address or a poem - from one added by a PDF, so choose Keep lines for that kind of text. Some invisible characters are not spaces at all; find them with the Hidden Character Detector. For targeted changes, use Find and Replace Text.

Frequently Asked Questions

PDFs store text as positioned lines, not paragraphs, so copying adds a line break at the end of every printed line. Choose "Keep paragraphs, join broken lines" to fix it.

Yes, with the default option. A blank line marks a new paragraph and single line breaks inside a paragraph are joined with a space.

Choose "Remove all line breaks (one paragraph)". Every line break becomes a single space, which is useful for pasting text into a form field or a spreadsheet cell.

A non-breaking space looks like a normal space but stops a line break between two words. It often comes from web pages and Word documents and can upset searches and comparisons.
Share this tool: