ReplaceKit

How to remove line breaks in Google Docs (text pasted from a PDF)

Text copied from a PDF arrives in Google Docs with a break at the end of every printed line, so each sentence is chopped into short paragraphs. Docs' own Find and replace cannot fix this: it cannot match a paragraph break, and anything you type in "Replace with" is inserted as plain text (Google's help, checked 1 November 2026; quoted in the sources). Here are the ways that work, from the quickest to the one that keeps your formatting.

1. Before you paste

2. Short passage: join the lines by hand

Put the cursor at the end of a broken line and press Delete (Fn+Delete on a Mac), then type a space if the words run together. Workable for a paragraph or two.

3. Long text: clean it in a text editor, then paste back

Quickest: paste it into our free remove-line-breaks tool (runs in your browser, nothing is uploaded), copy the result back. Or any editor with regex find and replace can join the lines in one go. In VS Code (free) or Notepad++ (free, Windows):

  1. Paste the PDF text into a new file and open Replace (Ctrl+H). Turn on regular expressions (.* in VS Code, "Regular expression" in Notepad++).
  2. Rejoin words split by a hyphen at the line end: find -\n(?=[a-z]), replace with nothing. (Check the result: real hyphenated words at a line end lose their hyphen too.)
  3. Join the lines but keep real paragraphs (a blank line between them): find ([^\n])\n(?!\n), replace with $1 (a space after $1).
  4. Copy everything and paste it into Google Docs.

Before and after, on a sample we ran through these two steps:

This is a line from a PDF that wraps
in the middle of a sen-
tence and keeps going.

New paragraph here
and its second line.
This is a line from a PDF that wraps in the middle of a sentence and keeps going.

New paragraph here and its second line.

If your PDF text has no blank lines between paragraphs, step 3 joins everything into one block. Then join lines that do not end in ., ?, ! or : instead: find ([^.?!:\n])\n, replace with $1 .

The catch: this works on plain text. If the text is already in your document with headings, bold or links, copying it out and back loses them.

4. Inside the document, formatting kept: ReplaceKit

ReplaceKit is a Google Docs add-on we are building. Its Find box can match paragraph breaks (\n) and line breaks (\v), so the same clean-up runs inside Docs, only on the part you select, with the bold and links left in place and a preview of each match before you replace. The steps above become:

StepFind (regex on)Replace with
Rejoin hyphenated words-\n(?=[a-z])(nothing)
Join broken lines, keep paragraphs([^\n])\n(?!\n)$1
Join lines that don't end a sentence([^.?!:\n])\n$1
Soft line breaks (Shift+Enter) to spaces\va space

Free: every single find and replace, no click limit, no trial. Pro ($6/month or $48/year): save these steps as a rule set and run them in one click on the next PDF paste.

ReplaceKit is built and in testing. It is not in the Google Workspace Marketplace yet. Leave your email and we send one message when you can install it.

You're on the list. We'll email you when ReplaceKit is ready.

The free version will have no click limit or trial clock.

More ReplaceKit guides

Sources