About the Remove Line Breaks
Remove line breaks from text and join every line into one continuous line. Each newline, and each group of blank lines, is swapped for a single space, so the words still read correctly. Reach for it when text copied from a PDF, an email or a chat breaks mid-sentence, or when a form, a subject line or a spreadsheet cell will only take a single line.
The joined text appears as soon as you paste and is ready to copy straight away. Nothing is uploaded: the line breaks are removed by your browser.
How lines are joined
The tool searches for carriage return and line feed characters, the two characters that end a line. Windows files end lines with both (CRLF), macOS and Linux with a line feed only (LF), and very old Mac files with a carriage return alone (CR). A run of them, one after another, is replaced with a single space, so one newline and five blank lines in a row are treated the same way.
Only line endings are touched. Spaces and tabs that were already in the text stay where they are, which keeps code-like or tabular content recognisable. At the end, the start and end of the result are trimmed, so a trailing newline doesn't leave a dangling space.
Because paragraph breaks are line breaks too, separate paragraphs end up in one block. If you want to delete newlines but keep paragraphs apart, join one paragraph at a time.
output = input.replace(/[\r\n]+/g, " ").trim()
Assumptions and limits
- A space left at the end of a line is kept, and the line break adds another, so you can get two spaces in a row. Run the result through Remove Extra Spaces if that matters.
- A line of only spaces between two lines turns into several spaces, because the spaces themselves aren't line breaks.
- Words hyphenated across lines stay split: "infor-" and "mation" become "infor- mation". Fix those by hand.
- Tabs are kept, so tab-separated columns stay tab-separated on the single line.
- Unicode line and paragraph separators (U+2028, U+2029), which a few apps use instead of newlines, are not removed.
Worked examples
Join lines of a short email
An email with the greeting, two wrapped lines, a blank line and a sign-off becomes one line. The blank line between the body and "Thanks," collapses to a single space, not two.
Dear team, The meeting is moved to Friday. Thanks, Ali → Dear team, The meeting is moved to Friday. Thanks, Ali
Fix text copied from a PDF
PDFs store each printed line separately, so a copied paragraph arrives with a break every 60 to 90 characters. Paste it here and the paragraph reads as one flowing line again, ready for a document or a translation tool.
Make a single line for a form field
An address written on four lines (house, street, city, postcode) becomes "House 12 Street 5 Lahore 54000" for a one-line delivery field. Add commas afterwards if the form needs them.
Line endings the tool removes
| Line ending | Characters | Typical source | Removed |
|---|---|---|---|
| LF | \n | macOS, Linux, most web forms | Yes |
| CRLF | \r\n | Windows Notepad, Word, Outlook | Yes |
| CR | \r | Classic Mac OS files | Yes |
| Blank lines between paragraphs | \n\n or more | Any editor | Yes, become one space |
| Line separator | U+2028 | Some apps and JSON data | No |
| Tab | \t | Spreadsheets, tables | No, kept as is |
How to use the Remove Line Breaks
- Paste the multi-line text. Put it in the Input Text box, replacing the sample sentence. The counter shows how many characters you pasted.
- Check the single line. The Result box now holds everything on one line. Scroll it to look for double spaces or split hyphenated words.
- Copy it where it's needed. Press Copy and paste the line into the subject, cell or field. Clear empties the input for the next block.
Frequently asked questions
How do I remove line breaks from copied text?
Copy the multi-line text and paste it over the sample. Each newline turns into a space, the joined line appears in the Result box, and one press of Copy sends it to your clipboard. Text from a PDF, an email, a chat or a document is handled the same way.
Will it keep the spaces between words when lines are joined?
Yes. Each line break becomes a space, so the last word of one line and the first word of the next don't run together. The only extra cleanup you may want is removing a double space where a line ended with a space.
Can I remove line breaks but keep paragraphs?
Not in one pass, because a paragraph break is just two or more line breaks and the tool turns those into one space as well. Join each paragraph separately and put the empty lines back between them.
Does it handle Windows and Mac line endings?
Yes. Windows CRLF, Unix and macOS LF and old-style CR endings are all recognised, even mixed in one text. Browsers also normalise line endings in a text box, so pasted text from any system behaves the same.
How is this different from Remove Extra Spaces?
This tool only deletes newlines and leaves spaces and tabs alone. Remove Extra Spaces collapses every kind of whitespace, including tabs, runs of spaces and newlines, into single spaces. Pick that one when the text is messy everywhere, not just at line ends.
Can I put the line breaks back afterwards?
Not automatically: there's no undo for the joined text. Your original stays in the input box until you change or clear it, though, so you can copy it again. Keep a copy of the original if you might need the line layout later.
This tool runs entirely in your browser. What you enter or upload stays on your device and is never sent to our servers.