You copy a paragraph from a PDF, an email, or a code block, paste it somewhere new, and it arrives shattered — broken into a dozen short lines with a hard return at the end of each one. Now you can’t reflow it, the sentences won’t wrap properly, and editing it is miserable. Those hard returns are line breaks, and stripping them out turns the jagged mess back into clean, continuous text. This guide shows the fastest way to remove line breaks from any text online, how to do it in Word, Excel, and Notepad++, and — the part most tools get wrong — how to remove the unwanted breaks while keeping your real paragraph breaks intact.
Why pasted text breaks into short lines
The culprit is usually the source. PDFs, plain-text emails, terminal output, and code comments often hard-wrap every line at a fixed width — they insert an actual line break character at the end of each visual line, rather than letting the text flow and wrap on its own. When you paste that into a document or a form, those hard breaks come along, so a single sentence that was wrapped across three lines stays broken across three lines forever.
There are two invisible characters at play, which is worth knowing because it explains odd behavior across systems:
| Character | Name | Where it’s common |
|---|---|---|
\n | Line Feed (LF) | Mac, Linux, the web |
\r\n | Carriage Return + Line Feed (CRLF) | Windows |
Most tools handle both, but a stray \r is occasionally why text looks fine in one program and broken in another.
The fastest way: paste, strip, copy
The quickest method runs in your browser, with nothing to install:
- Copy your broken text.
- Paste it into the remove line breaks tool.
- Choose how to handle the breaks (remove entirely, replace with spaces, or keep paragraphs).
- Copy the clean result.
Because it runs locally, nothing you paste is uploaded — fine for confidential text. The key feature is the choice of what a removed line break becomes, which is the difference between a clean paragraph and a wall of words with no spaces between them.
Remove vs replace-with-space
This distinction matters more than it first appears. If line breaks sit between words, deleting them outright glues the words together:
- Broken input:
the quick brown\nfox jumps - Removed (no space):
the quick brownfox jumps❌ - Replaced with space:
the quick brown fox jumps✓
So for normal prose, you almost always want replace with a space. Removing breaks entirely is right only when the breaks fall between characters that should touch — joining a split-up code string or a number, for instance.
Keeping paragraphs while removing line breaks
Here’s the problem with a blunt “delete all line breaks” approach: it flattens everything into one giant block, destroying the paragraph structure you actually want to keep. Real text has two kinds of breaks:
- Single line breaks inside a paragraph — usually the unwanted hard-wrap you want gone.
- Double line breaks (a blank line) between paragraphs — the structure you want to preserve.
A good tool distinguishes them. The remove line breaks tool offers a keep paragraphs mode that collapses single breaks within a paragraph into spaces while leaving the blank lines between paragraphs alone. That turns this:
The first paragraph is
wrapped awkwardly across
several short lines.
The second paragraph is
also broken up.
…into two clean, properly separated paragraphs instead of one undifferentiated blob. If your text also has stray double spaces or other formatting cruft left over, finish with the text cleaner to normalize the spacing.
How to remove line breaks in Microsoft Word
Word can do it with Find and Replace, using its special codes:
- Press Ctrl+H to open Find and Replace.
- In Find what, type
^p(paragraph mark) or^l(manual line break) — match whichever your text uses. - In Replace with, type a single space (or leave it empty to delete).
- Click Replace All.
The tricky part is paragraphs: a blanket replace of ^p flattens everything. To keep paragraphs, the usual trick is to first replace the double paragraph marks (^p^p) with a placeholder like @@@, then replace the remaining single ^p with a space, then swap @@@ back to ^p^p. It works, but it’s fiddly — which is exactly the case the in-browser tool’s “keep paragraphs” mode handles in one click.
How to remove line breaks in Excel
In a spreadsheet cell, line breaks (entered with Alt+Enter) can break formulas and exports. Two ways to strip them:
- Find and Replace: Press Ctrl+H, put the cursor in Find what, and press Ctrl+J (this enters the invisible line-break character). Leave Replace with as a space, then Replace All.
- Formula: Use
=SUBSTITUTE(A1, CHAR(10), " ")to replace line feeds with spaces, orCHAR(13)for carriage returns.
The SUBSTITUTE formula is the cleaner choice when you want to keep the original cell intact.
How to remove line breaks in Notepad++
For developers and anyone handling large text files, Notepad++ is fast:
- Open Search → Replace (Ctrl+H).
- Set Search Mode to Extended.
- In Find what, type
\r\n(or\nfor Unix files). - In Replace with, type a space or leave it empty.
- Click Replace All.
Extended mode is what makes \r\n match the actual line-break characters rather than the literal text.
A quick comparison
| Method | Best for | Keeps paragraphs? | Choose space vs none? |
|---|---|---|---|
| Remove line breaks | Any text, anywhere | Yes (mode) | Yes |
| Microsoft Word | Text already in a doc | With a workaround | Yes |
| Excel | Line breaks inside cells | N/A | Yes (formula) |
| Notepad++ | Large files, developers | Manual | Yes |
When you’ll need this
Removing line breaks comes up whenever text crosses between systems:
- Pasting from PDFs — almost always hard-wrapped, the single most common case.
- Cleaning email replies — quoted plain-text email wraps at ~70 characters.
- Reflowing code comments or logs into readable prose.
- Preparing text for a CMS or form that expects continuous paragraphs.
- Fixing spreadsheet exports where in-cell breaks corrupt a CSV.
Once the breaks are gone, you might want to tidy the result further — collapse extra spaces with the text cleaner, drop repeated lines with the duplicate line remover (see how to remove duplicate lines), or recount the cleaned text with the word counter.
The bottom line
Removing line breaks turns text that’s been shattered into short hard-wrapped lines back into clean, continuous prose. The fastest way is to paste it into the remove line breaks tool, choose to replace breaks with spaces (so words don’t glue together), and copy the result — and use keep paragraphs mode when you want the blank lines between paragraphs preserved. Word, Excel, and Notepad++ can all do it with Find and Replace, but they need workarounds to protect paragraph structure, which is the one detail that separates a clean result from a flattened blob.
Frequently Asked Questions
How do I remove line breaks from text online?
Paste your text into the remove line breaks tool, choose whether to replace breaks with spaces or delete them, and copy the result. It runs entirely in your browser and can keep your paragraph breaks while removing the unwanted ones.
Should I replace line breaks with a space or nothing?
For normal sentences, replace them with a space — otherwise the words on either side of the break glue together. Delete them entirely only when the broken pieces should touch, such as rejoining a split code string or number.
How do I remove line breaks but keep paragraphs?
Use a tool that distinguishes single breaks (inside a paragraph) from double breaks (between paragraphs). The remove line breaks tool’s “keep paragraphs” mode collapses the single breaks into spaces while preserving the blank lines between paragraphs.
How do I remove line breaks in Word?
Open Find and Replace (Ctrl+H), put ^p or ^l in “Find what,” and a space in “Replace with,” then Replace All. To keep paragraphs, first protect the double paragraph marks with a placeholder, replace the single ones, then restore the placeholder.
Why does my pasted text have a line break on every line?
The source — often a PDF, plain-text email, or terminal output — hard-wraps each line by inserting an actual line-break character at the end. Those characters come along when you paste, so the text stays broken until you strip them.
What’s the difference between a line break and a paragraph break?
A single line break (\n) ends one line within a paragraph; a paragraph break is typically a blank line (a double break) separating two paragraphs. Removing line breaks while keeping paragraph breaks means collapsing the single ones but leaving the doubles intact.