Skip to content
Text Cleanup Tools

Text Cleanup Tools › Guides

How to remove line breaks from text copied from a PDF

You copy a paragraph out of a PDF, paste it into an email or a document, and every line ends in a hard break. Here is why that happens and how to fix it in a minute.

Why PDF text pastes with broken lines

A PDF is a page description, not a flowing document. Most PDFs store text as short runs placed at exact positions on the page, one visual line at a time. There is no stored paragraph that wraps to fit a width. When you copy, your PDF viewer has to guess, and the safest guess is to end each visual line with a line break.

Pasted somewhere with a different width, those breaks do not match the new layout. The result is short ragged lines, odd gaps and text that will not reflow when you resize the window.

The quick fix, step by step

  1. Copy the text out of the PDF and paste it into the box on the Remove Line Breaks tool.
  2. Choose to replace each break with a space. Use a comma and space instead if you are building a list, or nothing if the lines were cut mid-word.
  3. Tick "keep blank-line paragraph breaks" if the pasted text has empty lines between paragraphs. The tool then joins lines inside a paragraph but leaves the gaps between paragraphs alone.
  4. Press Copy and paste the result where you need it.

When paragraphs have no blank line between them

Many PDFs do not put an empty line between paragraphs, only an indent or a little extra vertical space that does not survive copying. In that case the tool has nothing to tell a paragraph end from a line wrap, and it joins everything into one block.

If that happens, join the text first, then put your paragraph breaks back by hand where they belong. For long runs of sentences, the Add Line Breaks tool can start a new line after every sentence, which gives you a starting point to edit.

Fixing words split across two lines

PDFs often hyphenate a word at the end of a line, so "information" arrives as "infor-" on one line and "mation" on the next. After you join the lines you get "infor- mation" with a space.

The Find and Replace tool can repair these in one pass. Turn on its regular-expression option, search for (\w)-\s+(\w) and replace with $1$2. That joins any letter, hyphen, space and letter back together. Review the result afterwards, because it also removes the hyphen from genuine compounds that happened to be split across a line, such as "well-known".

Cleaning up what is left

  • Doubled spaces: run the result through Remove Extra Spaces. PDFs sometimes pad lines to justify them.
  • Empty lines: use Remove Blank Lines if the copy produced rows of nothing between lines.
  • Page numbers, headers and footers: these paste as lines in the middle of your text. There is no safe way to detect them automatically, so scan the result for them. If a header repeats exactly, Find and Replace can delete it.
  • Columns: text from two-column pages may paste one line from the left column, then one from the right. Copy one column at a time instead.
  • Scanned PDFs: if the PDF is a scan, there is no real text to copy. You need OCR software first, which is a different job from this one.

Is my document uploaded anywhere?

No. These tools run as JavaScript in your browser tab. The text you paste is processed on your device and is not sent to a server, which matters when the PDF is a contract or other private document.

Tools used in this guide

More guides

Last reviewed 2026-10-14.