Skip to content
EditFlip
ENRO
Back to blog
Edit PDF

How to copy text from a PDF without line breaks

You paste one paragraph and it arrives chopped into short lines. Here is why, and the quick ways to get flowing text back.

Eric Rada · Founder · · 7 min read

In short

  • A PDF stores every line of a paragraph as its own piece, so a paste ends each line with a hard return. Replace those returns with spaces once you have pasted.
  • In Word, search for ^p and replace it with a space. In Google Docs, turn on regular expressions and replace \n with a space. Then fix the real paragraph breaks.
  • Turn a PDF into a Word file you can tidy, free in your browser

A PDF does not know what a paragraph is. When it was made, every line was placed on the page on its own, and the file only remembers where each line sits. When you copy a block and paste it, the program has no sign of where the paragraph ends, so it ends every line as if you had pressed Enter. A paragraph of ten lines arrives as ten short lines.

The fix is the same in almost every program: after pasting, swap the hard returns for spaces, then put back the few that really mark a new paragraph. This guide shows how to do that in Word and Google Docs, how to avoid the problem for hyphens and bullet lists, and how to convert a whole PDF to Word on EditFlip when copying page by page would take too long.

On EditFlip, step by step

  1. Step 1

    Choose the PDF on the Convert page

    Go to editflip.com/pdf-to-word and press Choose a PDF, or drop the file on the page. This suits a long document, where selecting and pasting page by page would be slow. One PDF at a time, up to 100 MB.

  2. Step 2

    Wait for the conversion

    There is nothing to set. The pages are read one by one and you can watch the progress. If the PDF asks for a password, you type it first. A scanned PDF comes as pictures, so for that kind run OCR first from the home page.

  3. Step 3

    Download the .docx and open it in Word

    Press Download, or Share on a phone. The file keeps the PDF's name and ends in .docx. Open it in Word or in Google Docs. Each PDF line is its own line there, so the line breaks are still in place at this point, which is what the next step cleans up.

  4. Step 4

    Replace the line breaks with spaces

    In Word, press Ctrl and H, put ^p in Find what and a single space in Replace with, and press Replace All. If nothing changes, try ^l instead, which is Word's code for a manual line break. Then press Enter again where a new paragraph really begins.

Why every line ends in a hard return

Think of a PDF as a printed page that has been photographed with the text kept as text. The program that made it wrote each line at an exact spot, in order, one after another. It never wrote the idea of a paragraph, because a printer does not need one.

A paragraph in a Word file works the other way round. The words run on, and the program wraps them at the edge of the page. Press Enter only where a new paragraph starts. When you paste text that was cut at a fixed width into that file, the line ends stay where they were, and the result looks ragged as soon as the width of the page is different.

That is also why the problem comes back in every program. A browser, a chat window and a notes app all take the return characters literally. The cure is not a setting. It is a short clean-up after the paste.

The quick fix in Word

Paste the text, then press Ctrl and H to open Find and Replace. In the Find what box type ^p, which is Word's code for a paragraph mark. In Replace with, type one space. Press Replace All. Every line end becomes a space and the text flows into one block.

The catch is that this also removes the breaks that were real. If your text has a blank line between paragraphs, first replace ^p^p with a rare marker such as ### so those stay safe. Then replace ^p with a space, then replace ### with ^p. Three replacements, and the paragraphs come back where they belong.

On a Mac the same box opens with Command and F, with the replace field behind a small arrow. If ^p seems to do nothing, the lines may be separated by a manual line break instead of a paragraph mark. Try ^l in the Find what box with the same space in the Replace with box.

The quick fix in Google Docs

Google Docs has no ^p, but it understands regular expressions, which are a short way of describing text. Press Ctrl and H, tick the box that says Match using regular expressions, type \n in the Find box, put a single space in the Replace with box, and press Replace all.

As in Word, this also joins real paragraphs. Do the same trick with a marker: replace \n\n with ### first, then \n with a space, then ### with \n\n. If a paragraph was lost, the Undo arrow brings the text back and you can try again.

Pasting without formatting, with Ctrl, Shift and V, helps with fonts and colours but does not touch line ends. Do not expect it to solve this problem.

Hyphens, bullets and columns

Words split at the end of a line cause the most trouble. A word such as information may arrive as infor- on one line and mation on the next. After the clean-up it reads infor- mation. Search for a hyphen followed by a space and replace it with nothing, then read the result, because a real hyphen, as in well-known, should stay.

Bullet lists and numbered lists copy with their symbols as ordinary characters. If you join the lines of a list, the items merge into one long sentence. Handle a list on its own: paste it, leave its returns alone, and apply the bullets again in your program.

Text set in two or three columns is the hardest case. A copy often runs straight across the page, so the first line of the left column is followed by the first line of the right one. Select one column at a time instead. If the program insists on selecting across, copy the whole page, accept the mess and sort it out by hand.

Converting the whole PDF to Word

For a document of many pages, selecting and pasting is slow and easy to get wrong. Converting the PDF to a Word file gets all of the text out at once, with its sizes, bold and italics.

Be clear about what you get. EditFlip builds the Word file line by line, because a PDF has no paragraphs to rebuild. The lines look right on the page, but they are still separate lines, so the clean-up with Find and Replace is still needed. What the conversion saves you is the selecting, the paging and the lost formatting, not the line breaks themselves.

Tables arrive as their text, with tabs between the columns, and a scanned PDF arrives as a picture, so the words cannot be changed. If you have a scan, run OCR first so the text becomes real text, then convert. The conversion runs in your browser and the PDF is not uploaded.

Doing it on a phone

On a phone, a long press selects a word and handles let you stretch the selection. Pasting into a notes app gives the same chopped lines. The Find and Replace trick is harder there, because phone apps often lack it.

The easier route on a phone is to convert the PDF to Word in the browser, send the .docx to your computer or open it in the Word app, and do the replacement where the tools are better. You can also paste the text into a message to yourself and clean it up on the computer later.

A paragraph or two does not justify all that. For a short quote, pasting and pressing Delete at each line end by hand is faster than any method.

Mistakes to avoid

Do not replace every return without protecting the paragraph breaks, or you will get one wall of text. Do not forget to read the result: after joining, a heading can end up glued to the paragraph below it, and a page number can sit in the middle of a sentence.

Headers, footers and page numbers get copied too, and they land in the middle of the text when a block crosses a page. Delete them before you join the lines. If a PDF refuses to let you copy anything at all, or the paste is full of strange symbols, that is a different problem and needs a different fix.

Choose the PDF and the text comes out as a Word file with its sizes, bold and italics, ready for the quick Find and Replace that joins the lines. It is free, runs in your browser on a phone or a computer, needs no account, and the PDF is not uploaded.

Convert a PDF to Word on EditFlip →

Questions

Why does copying from a PDF add a line break at every line?

The PDF stores every line on its own and has no idea where a paragraph ends. A paste therefore ends each line as if you had pressed Enter.

How do I remove line breaks after pasting in Word?

Press Ctrl and H, type ^p in Find what, put a space in Replace with and press Replace All. If nothing changes, try ^l, the code for a manual line break.

How do I do it in Google Docs?

Press Ctrl and H, tick Match using regular expressions, type \n in Find, put a space in Replace with and press Replace all.

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

Replace the double return with a marker such as ###, then replace the single return with a space, then replace the marker with the double return again.

Does converting the PDF to Word remove the line breaks?

No. The Word file from EditFlip keeps each PDF line as its own line, so the Find and Replace step is still needed. The conversion saves you selecting and pasting.

What about words split by a hyphen at the end of a line?

After joining the lines, search for a hyphen followed by a space and remove it, then check the result. Real hyphens, as in well-known, should stay.

Can I copy from a scanned PDF without line breaks?

A scan has no text to copy. Run OCR first to make the text real, then copy or convert, and clean up the line ends in the same way.

Is my PDF uploaded when I convert it?

No. The conversion happens in your browser and the file stays on your device.

Do it right in your browser.
Free, no account. Your files stay on your device.
Convert a PDF to Word