Remove Line Breaks
Remove line breaks from text online and join your lines into one. Replace each break with a space, nothing or a comma, collapse extra spaces, free and private.
Updated 2026-06-09 · Free · No sign-up · Runs privately in your browser
How the cleanup is applied
What does Remove Line Breaks do?
Remove Line Breaks takes text spread across many lines and joins it into one continuous line by deleting the newline characters. You paste your text, pick how each break should be replaced, and the cleaned-up result appears instantly. There is no upload and no button to wait on — it updates live in your browser.
The tool gives you three ways to handle each break: replace it with a single space, with nothing (joining lines directly), or with a comma plus a space. An optional setting collapses any run of repeated spaces down to one and trims whitespace from the ends, so you are left with tidy single-line text.
How does removing line breaks work?
A line break is an invisible newline character in your text — usually \n (line feed), sometimes paired as \r\n on Windows. Pressing Enter inserts one; it tells software to start a new line. This tool simply finds every one of those characters and replaces it with the substitution you chose.
The method, in plain terms:
- Replace with space — every line break becomes a single space character, so neighbouring lines are separated by exactly one space.
- Replace with nothing — every line break is deleted with no replacement, so the end of one line touches the start of the next.
- Replace with comma — every line break becomes a comma followed by a space (
,), turning a stack of lines into a comma-separated list. - Collapse extra spaces — after joining, any run of two or more spaces is reduced to one, and leading and trailing spaces are trimmed away.
Blank lines and paragraph breaks are made of the same newline characters, so they are removed along with ordinary single breaks. Nothing else in your text is altered — letters, punctuation and existing single spaces are left untouched except where the collapse option tidies spacing.
Examples
The clearest way to understand each option is to run the same three lines through it. Start with this text, one item per line:
one.
two.
three.
Example 1 — replace with a space. Each break becomes one space, so the three lines flow together:
one. two. three.
Example 2 — replace with nothing. Each break is deleted with no replacement, so the lines join directly with no gap:
one.two.three.
Example 3 — replace with a comma. Each break becomes a comma plus a space, producing a comma-separated line:
one., two., three.
Example 4 — collapse extra spaces. Suppose a line break sat between words that already had trailing spaces, leaving hello world after joining. With collapse on, the run of spaces is squeezed to one and the ends trimmed, giving hello world.
Option reference
This table summarises exactly what each setting produces for the same three input lines (one., two., three.):
| Setting | Replacement applied | Result for the three lines |
|---|---|---|
| Replace with space | one space per break | one. two. three. |
| Replace with nothing | empty (direct join) | one.two.three. |
| Replace with comma | comma plus a space | one., two., three. |
| Collapse extra spaces | many spaces become one, ends trimmed | tidies spacing on the joined line |
What is removing line breaks used for?
Joining lines into one is handy whenever text arrives broken up but you need it flat. Common scenarios:
- Pasted PDF or email text — copying from a PDF or hard-wrapped email often drops a line break after every line; the space option restores readable prose.
- Cleaning data for a spreadsheet — the comma option turns a vertical list into a single comma-separated row you can paste into one cell or split into columns.
- Fixing code or config strings — the nothing option rejoins a value that was wrapped across lines, such as a long token or URL, with no stray spaces.
- Preparing copy for fields — single-line input boxes, CSV cells and some CMS fields reject newlines, so flattening the text first avoids errors.
Tips and common mistakes
Pick the replacement that matches your goal. Use space for sentences and prose so words do not run together; use nothing only when the lines should touch, such as parts of a code string; use comma when you genuinely want a list. The most common mistake is choosing nothing for ordinary sentences and ending up with one.two.three. where words are glued together.
Turn on collapse when your source has messy or double spacing — it cleans up the run of spaces that can appear where a line already ended in a space. Conversely, leave it off if your text contains intentional multiple spaces (for example, fixed-width alignment) that you need to preserve, because collapse will flatten them.
Remember the comma option does not add a comma before the first line or after the last — it only replaces the breaks between lines, so a three-line input gives two commas, not three.
Limitations and notes
This tool removes line breaks; it does not add them back. Joining is one-way, so once you flatten the text the original line positions are gone — keep a copy if you might need the structure later. It also treats every newline the same way, meaning deliberate paragraph spacing is removed along with accidental wrapping. It does not split text back into lines, change letter case, or wrap text to a fixed width — it only joins.
Everything runs locally in your browser using JavaScript. Your text is never uploaded, stored or logged, which makes the tool safe for confidential drafts, private data and unpublished work, and it keeps working offline once the page has loaded.
Related tools
Working with text? Try the word counter to check length after joining, the case converter to normalise capitalisation, or the text repeater to duplicate a cleaned line. Browse more in the text tools category.
Frequently asked questions
How do I remove line breaks from text?+
Paste your text, choose whether each break becomes a space, nothing or a comma plus space, and the joined result appears instantly in your browser.
What does the replace-with-space option do?+
It swaps every line break for a single space, so three lines reading one. / two. / three. become one. two. three. on a single line.
What is the difference between the space, nothing and comma options?+
Space inserts one space at each break, nothing joins lines directly with no gap, and comma inserts a comma plus a space, turning the lines into one., two., three.
Does it collapse multiple spaces into one?+
Yes, when the collapse option is on it squeezes any run of repeated spaces down to a single space and trims spaces from the start and end of the result.
Will this remove paragraph breaks and blank lines too?+
Yes, every newline character is treated as a line break, so blank lines and paragraph breaks are removed along with single line breaks.
Is my text uploaded or stored anywhere?+
No, everything runs entirely in your browser with JavaScript, so your text is never sent to a server, logged or saved.
Can I get my original line breaks back after joining?+
No, joining is one-way and discards where the breaks were, so keep a copy of the original if you might need the line structure again.