Remove Line Breaks
Paste text with line breaks and instantly join it into one clean block — with a space, with nothing, or Smart mode that keeps paragraphs and fixes PDF copy-paste wrapping.
Every line break becomes a single space.
Paste text above to remove line breaks
Why removing line breaks is trickier than "just delete \n"
A line break looks like a single, simple thing, but text arrives with line breaks for several different reasons, and each one calls for a different fix. A spreadsheet cell might have a manual line break you want gone entirely. A PDF paragraph copied into a text box comes with a hard line break at the end of every printed line, even mid-sentence — deleting those the wrong way glues words together (helloworld) instead of leaving a space (hello world). And a document with real paragraphs has blank lines you usually want to keep, so a blanket "delete all newlines" pass would flatten your paragraphs into one giant run-on block. This tool gives you three explicit, predictable ways to join lines instead of one guess-and-check regex, and shows you exactly how many line breaks were removed and how the character count changed.
The three join modes explained
- Join with a space — every line break, including blank lines between paragraphs, becomes exactly one space. Best for turning a short multi-line list or address into one continuous line.
- Join with nothing — every line break is deleted and no space is added. Best when each line already ends with a trailing space in your source, or when you deliberately want two line-fragments glued into one token (for example, reassembling a word or code identifier that got split across lines).
- Smart — keep paragraphs — finds your blank-line paragraph breaks first, keeps exactly one blank line between paragraphs, and only unwraps the hard line breaks inside each paragraph by joining them with a space. This is the PDF copy-paste fix: it turns a jagged column of short printed lines back into normal flowing paragraphs.
Worked examples
Example 1 — a list, "space" mode. Input:
Apples
Bananas
Cherries
Output: Apples Bananas Cherries — three lines become one line, cleanly separated by single spaces.
Example 2 — a split identifier, "nothing" mode. Input:
data-i18n-
placeholder
Output: data-i18n-placeholder — the two fragments were meant to be one token, so gluing them with no space reconstructs the original.
Example 3 — a PDF paragraph, "Smart" mode. Input (each line ends where the printed page happened to wrap):
This report summarizes the
quarterly results and outlines
next steps for the team.
A second paragraph starts
here, after the blank line.
Output: This report summarizes the quarterly results and outlines next steps for the team. followed by a blank line, then A second paragraph starts here, after the blank line. — the two paragraphs stay separated, but the awkward mid-sentence breaks are gone.
Where this comes up
| Source | Typical problem | Best mode |
|---|---|---|
| Text copied from a PDF | Every printed line has a real line break, even mid-paragraph | Smart |
| Spreadsheet or CSV cell | A manual line break inside one cell breaks import/export | Join with a space |
| Address or list pasted into a single-line field | Field only accepts one line | Join with a space |
| Word or code split across two lines by accident | Need the fragments glued back together exactly | Join with nothing |
| Song lyrics, poetry, or scripts with real stanza breaks | Want paragraph/stanza structure kept | Smart |
What Smart mode does — and does not — do
- It detects paragraph boundaries purely from blank lines (one or more consecutive empty lines), and normalizes any run of blank lines down to a single blank line between paragraphs.
- It unwraps every hard line break that falls strictly inside a paragraph, joining the fragments with one space, regardless of how the original line lengths varied.
- It does not reverse hyphenation. If a PDF broke a word across two lines with a trailing hyphen (for example
exam-/ple), Smart mode joins them asexam- ple, notexample— you may need to clean up hyphenated word breaks by hand afterward. - It does not detect sentence boundaries or re-flow text for a specific line width; it only removes breaks that shouldn't be there and keeps the ones that should.
Privacy and reliability
Every transformation runs with plain JavaScript string operations directly in your browser tab. Nothing you paste is sent to a server, logged, or uploaded anywhere, which makes this safe to use on drafts, internal notes, or anything else you'd rather not paste into a random web form. Your last input and selected mode are optionally remembered in this browser's local storage so the tool is ready again next time you open it; you can turn that off at any time.
Sources & further reading
Frequently asked questions
How do I remove line breaks from a block of text?
Paste your text into the box above and pick a join mode: “Join with a space” replaces every line break with a single space so words never run together, “Join with nothing” deletes every line break outright with no space added, and “Smart” keeps blank-line paragraph breaks while only unwrapping single hard-wrapped lines inside each paragraph. The result updates instantly as you type or paste, and a Copy result button puts the cleaned text on your clipboard in one click.
What's the difference between “Join with a space” and “Join with nothing”?
“Join with a space” turns every line break — including the blank line between paragraphs — into a single space, so “Hello” and “world” on two lines become “Hello world”. “Join with nothing” removes only the line break character and adds no space, so the same input becomes “Helloworld”; use this when your source text already ends each line with a trailing space, or when you specifically want two broken halves of a word glued back together.
How does Smart mode fix text copied from a PDF?
PDF readers and many apps insert a real line break at the end of every printed line, even in the middle of a paragraph — this is called hard wrapping. Smart mode looks for blank lines to find where paragraphs actually end, then joins every hard-wrapped line inside a paragraph with a single space while leaving the paragraph break untouched. The result reads like normal flowing text instead of a jagged column of short lines, which is exactly the PDF copy-paste fix most word processors don't offer on their own.
Will Smart mode delete the blank lines between my paragraphs?
No — Smart mode is designed to preserve paragraph structure, not remove it. Wherever your original text has one or more blank lines, the result keeps exactly one blank line, so paragraphs stay visually separated. Only the hard line breaks inside a paragraph — the ones caused by word-wrapping — are unwrapped into a single line. If you want paragraph breaks removed too, switch to “Join with a space” or “Join with nothing” instead.
Is my text uploaded to a server?
No. Every transformation runs entirely inside your browser — the text you paste is never sent to a server, logged, or shared anywhere. Your most recent text and selected mode are optionally saved to this browser's local storage so they're still here next time you open the page; untick “Save my text in this browser” to keep it in memory for this session only, and clearing the box removes the stored copy immediately.