How to Remove Line Breaks From Copied Text (Without Losing Paragraphs)
Updated 2026-10-13 · 7 min read
Copy a paragraph out of a PDF and you get a document that looks like a poem: every visual line has become a real line break, so the text reflows into a ragged column the moment you paste it anywhere narrower. The problem is that the breaks you want to delete and the breaks you want to keep look identical on screen. Here is how to tell them apart and remove only the ones you do not need.
Hard breaks and soft breaks
A soft break is a visual convenience. Your editor wraps a long line to fit the window, and if you resize the window the wrap point moves. It is not a character and nothing is inserted into the text.
A hard break is a real character in the file. It was inserted deliberately, by a person pressing enter or by a program writing a line ending. It travels with the text when you copy it, and it is what makes pasted PDF text look broken.
Every word processor has a mode that displays hard breaks as visible marks, and turning it on is the fastest way to see which one you are dealing with.
How to tell which ones you have
- Turn on formatting marks, called paragraph marks in most editors, and hard breaks appear as a pilcrow or arrow symbol
- Click at the end of a line and press End. If the cursor jumps to the next line, there is a hard break there
- Paste into a plain text editor. Hard breaks survive, soft wraps do not
- Paste into a browser text counter. The word count is usually unaffected, but the character count will be noticeably higher than expected if hard breaks came along
The rule that solves it
Single line breaks become spaces. Double line breaks stay. The logic is that a PDF or a quoted email inserts a break at every visual line, which is always a single break, while a genuine paragraph boundary is almost always rendered as a blank line, which is a double break.
Apply that rule and the integrity of your paragraphs survives while the artificial breaks disappear. Apply a blanket removal instead and you will join every paragraph into one enormous block, which is much harder to reverse than it was to create.
Doing it in a word processor
The naive approach is to search for the paragraph mark and replace it with a space, which removes every break including the ones that mattered. The better approach uses a pattern that only matches a break between two lowercase letters, which is the signature of a line wrapped mid sentence.
- In Word, use find and replace with regular expressions enabled, and replace a lowercase letter followed by a paragraph mark followed by a lowercase letter, keeping both letters and inserting a space between them
- In Google Docs, the same approach works with regular expressions enabled in find and replace
- Work in a duplicate of the document, because a replacement applied to a hundred breaks by accident takes far longer to undo than to prevent
Doing it in a browser
A browser tool is faster than a regex when you do not need the pattern, and it has one real advantage: nothing is uploaded. Well built formatters run entirely in JavaScript in your page, so confidential text never leaves your machine.
The workflow is to paste, apply the single and double break distinction, then copy the cleaned result back to wherever it came from.
When to remove every break instead
There are cases where you genuinely want one continuous string with no breaks at all.
- Pasting a multi line address or paragraph into a single line form field
- Preparing text for a spreadsheet cell, where line breaks make the value awkward to sort
- Preparing text for a JSON string, where a literal line break is invalid
- Preparing text for a command line argument or a search query
Checking the result
After cleanup, count the text again. The count you had before cleanup was inflated by breaks that were never part of the prose, and it is worth knowing the real figure before you submit it anywhere.
Start with one of these
Every tool below runs in your browser. No download, no account.
Remove Duplicate Lines
Clean duplicate lines out of any list, with optional sorting.
Word Counter
Live word count, plus sentences, paragraphs and reading time.
Character Counter
Character count with and without spaces, plus platform limits.
Case Converter
Uppercase, lowercase, title case, sentence case and camelCase.
URL Slug Generator
Turn any title into a clean, SEO-friendly URL slug.
Lorem Ipsum Generator
Placeholder text by paragraph, sentence or word count.
Frequently asked questions
How do I remove line breaks from text copied out of a PDF?
Why did removing line breaks merge all my paragraphs?
Can I see where the hard line breaks are?
Does removing line breaks change the word count?
More guides
- How to Remove Duplicate Lines From a List Without Corrupting Your Data
- Character Count vs Word Count: What Each One Actually Measures
- How to Convert Text to Title Case Online (And When Not To)
- Lorem Ipsum Generator: Where the Text Comes From and How Much You Need
- URL Slug Generator for SEO: How to Write Slugs Google Understands
- Text Formatter Online: Five Cleanup Jobs Almost Everyone Needs
- How to Reduce Word Count Without Gutting Your Argument
- How to Count Characters in Google Docs (and Every Other Editor)
- The X Character Limit: What Counts Toward the 280 and What Does Not
- How Many Words Is a 5 Minute Speech? Speaking Rates That Actually Work
- What Counts as a Word? Hyphens, Numbers and Acronyms Explained
- How to Write a Meta Description That Earns the Click
- Capitalization Rules in English: The Ones That Cover Almost Everything
- The Best Free Online Writing Tools, and What Each One Is Actually For