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
- Paste without formatting (Ctrl+Shift+V, Cmd+Shift+V on a Mac) drops the PDF's fonts and sizes, but the line breaks stay: they are characters in the copied text, not formatting.
- Open the PDF with Google Docs (in Google Drive: right-click the PDF > Open with > Google Docs). Google converts it with text recognition. Results vary with the layout: some files come out as flowing paragraphs, others with the same broken lines.
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):
- Paste the PDF text into a new file and open Replace (Ctrl+H). Turn on regular expressions (
.*in VS Code, "Regular expression" in Notepad++). - 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.) - Join the lines but keep real paragraphs (a blank line between them): find
([^\n])\n(?!\n), replace with$1(a space after$1). - 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:
| Step | Find (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 | \v | a 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.
The free version will have no click limit or trial clock.
More ReplaceKit guides
- Free online tool: remove line breaks from any text (runs in your browser)
- Find and replace with a line break or paragraph break in Google Docs
- Find and replace formatting in Google Docs (bold, colour, highlight)
- Regex find and replace in Google Docs: capture groups and wildcards
- Find and replace in a selection only in Google Docs (and fixes when it is not working)
Sources
- Google Docs Editors Help: Find and replace text (checked 1 Nov 2026: "Regular expression replacements (including capture groups and special characters like \n for newlines) only work with Google Sheets. In Google Docs, any regex formatting entered into the "Replace with" field will be inserted as literal text.")
- RE2 syntax (the regex flavour Google Docs uses)
- Google Drive Help: Convert PDF and photo files to text