Remove Line Breaks

Paste text with awkward line breaks and get smooth, continuous paragraphs back. This free tool removes hard returns from PDF, email and scanned text, offers three joining modes, and runs in your browser so nothing is uploaded.

Remove Line BreaksPrivate · runs on your device
Input
Words 0Characters 0Lines 0
Text without line breaks

Example: This is a broken line. → This is a broken line.

How to remove line breaks

The result updates live, so you can switch modes and compare without pasting again.

  1. Copy the text from the PDF, email, ebook or document and paste it into the Input box.
  2. Open the Line breaks menu and choose a mode: Replace with a space, Keep paragraph breaks or Join without a space.
  3. Read the result in the box labelled Text without line breaks.
  4. Press Copy to use it, Download .txt to save it, or Use as input to run another clean-up on the result.

Nothing is uploaded, so contracts, academic papers and private correspondence can be processed without privacy concerns. The same steps work on a phone or tablet.

What each mode does

Here is one sample, a three-line paragraph followed by a blank line and a second two-line paragraph, run through all three modes.

ModeResult
Replace with a spaceThe quick brown fox jumps over the lazy dog near the river. A second paragraph starts here.
Keep paragraph breaksTwo paragraphs, with one blank line between them
Join without a spaceThe quick brown foxjumps over the lazydog near the river.A second paragraphstarts here.
  • Replace with a space turns every line break, with any spaces around it, into one space. Blank lines go too, so paragraphs merge. It also trims the ends and squeezes every run of two or more spaces in the text into one.
  • Keep paragraph breaks treats a blank line, even one holding only spaces, as a paragraph boundary. Single breaks inside a paragraph become spaces, and several blank lines shrink to one.
  • Join without a space removes only the line break characters and touches nothing else. Use it when lines were cut in the middle of a word or a code, and for scripts that do not use spaces between words.

Why text ends up with broken lines

A soft wrap is simply how an editor displays a long line inside its window, and is not stored in the text. A hard return is a real newline character, and that is what causes trouble. PDF files store text as positioned lines, so copying from one inserts a hard return at the end of every visual line. Plain text emails are often wrapped at around 72 characters with real newlines, and OCR output does the same.

After the join, a few things need a look. Words hyphenated across lines, such as docu- and ment, become docu- ment in the space mode and docu-ment in the no-space mode. The hyphen stays, so search for it and fix those words, perhaps with the find and replace tool. Bullet lists, poems, addresses and code lose their structure if you flatten them, and paragraphs marked only by an indented first line will not be detected as paragraphs.

Typical uses and next steps

  • Researchers and students quoting passages from PDFs and ebooks.
  • Editors cleaning manuscripts supplied as hard-wrapped plain text.
  • Translators preparing text so that machine translation sees whole sentences rather than fragments.
  • Developers flattening a multi-line string, log entry or key into one line. The no-space mode suits tokens that were split across lines.

Once the lines are joined, the whitespace remover clears any remaining irregular spacing, and the text formatting remover strips fancy characters. If the text came from a word processor, the plain text converter keeps its list structure, and the duplicate line remover deals with repeated lines.

As a rule of thumb, pick the mode from the source. A single quotation or an address that must sit on one line suits Replace with a space. A PDF or email with real paragraphs suits Keep paragraph breaks. A key, hash or web address that was wrapped in the middle suits Join without a space. Because the output refreshes immediately, it costs nothing to try each mode on the same text and keep the one that reads correctly.

Quick answers

Frequently asked questions

The questions people ask most, answered in plain words.

How do I remove line breaks from text copied from a PDF?

Paste the text into the Input box, then choose Replace with a space in the Line breaks menu. Each line break becomes a space and doubled spaces are squeezed to one. Choose Keep paragraph breaks instead if the PDF had blank lines between paragraphs you want to retain.

How do I keep my paragraphs and remove only the line breaks inside them?

Select Keep paragraph breaks in the Line breaks menu. Single line breaks inside a paragraph become spaces, while blank lines between paragraphs are kept as one blank line. This works when the source separates paragraphs with an empty line and not with an indent.

When should I choose Join without a space?

Choose it when lines were cut in the middle of a word or a code, such as a licence key, a hash or a long web address broken across lines. It also suits Chinese and Japanese text. It removes only the line breaks, so words from adjacent lines will run together.

Why are hyphenated words still split after joining?

The tool does not know whether a hyphen at the end of a line is a real hyphen or a break inside a word. It keeps the hyphen, giving docu- ment in space mode. Search for hyphens followed by a space and repair those words by hand.

Can I remove line breaks in Word or Google Docs instead?

Yes, with find and replace. In Word, search for ^p and replace it with a space. Google Docs offers a regular expression option in find and replace. This online tool is quicker because it also squeezes double spaces and can keep paragraph breaks.