Free Remove Line Breaks

Paste text with hard line breaks and instantly join it into one continuous block, replacing every newline with a space, nothing, or your own separator.

Result (updates live)

Quick answer

To remove line breaks, paste your text and the tool replaces every carriage return and line feed (CR, LF, and CRLF) with your chosen separator - a space by default, an empty string, or a custom character. Enable "collapse spaces" to merge the gaps left behind, or "keep paragraphs" to preserve blank-line breaks between paragraphs.

Formula & method

Join with separator

output = input with every CRLF, CR and LF replaced by separator
  • input the original multi-line text
  • separator the chosen replacement: a space, empty string, or custom characters
  • output the resulting single-line (or de-wrapped) text

CRLF (\r\n) is collapsed to one break before replacement so Windows text does not produce two separators.

Collapse spaces

if collapse is on: every run of spaces and tabs in output becomes a single space
  • run two or more consecutive space or tab characters

Keep paragraphs

if keep paragraphs is on: split on blank lines first, join breaks within each paragraph, rejoin paragraphs with a blank line

A blank line is two or more newlines in a row.

The tool normalizes all newline styles first: Windows CRLF (\r\n), classic Mac CR (\r), and Unix LF (\n) are each treated as a single line break. Every line break is then replaced with the separator you pick - a single space by default, an empty string to glue words together, or any custom text such as a comma or pipe. When "collapse multiple spaces" is on, runs of spaces and tabs left after joining are squeezed into one space so you do not get double spacing where lines met. When "keep paragraph breaks" is on, the text is first split on blank lines (two or more consecutive newlines) into paragraphs; line breaks inside each paragraph are replaced with the separator while the blank line between paragraphs is preserved as a double newline. All processing happens live in your browser as you type - nothing is uploaded.

Examples

Example 1: Join two lines with a space
Input
Hello World
Result
Hello World
Why
The single LF between the lines is replaced by the default space separator, producing one line with the words separated by a space.
Example 2: Remove breaks with no separator
Input
abc def ghi (separator = empty)
Result
abcdefghi
Why
With an empty separator each line break is deleted and the lines are glued directly together with nothing in between.
Example 3: Collapse spaces after joining
Input
one two three (separator = space, collapse on)
Result
one two three
Why
Replacing the breaks with spaces would leave "one two" with a double space after the first line's trailing space; collapsing merges each run of spaces into a single space.
Example 4: Keep paragraph breaks
Input
Line A Line B Line C Line D (separator = space, keep paragraphs on)
Result
Line A Line B Line C Line D
Why
The blank line splits the text into two paragraphs; breaks inside each paragraph become spaces while the blank line between paragraphs is preserved.

When to use this tool

  • Cleaning up text copied from a PDF or email where every visual line ends in a hard newline and you want flowing paragraphs.
  • Flattening a multi-line value into a single line for a CSV cell, spreadsheet field, or JSON string.
  • Converting a vertical list into a comma- or pipe-separated string by using a custom separator.

Common mistakes

  • Forgetting Windows files use CRLF: replacing only \n can leave stray carriage returns. This tool normalizes CR, LF and CRLF together so no orphan characters remain.
  • Using a space separator without collapsing, which leaves double spaces wherever a line had trailing whitespace - turn on "collapse multiple spaces" to fix it.
  • Removing all breaks when you only wanted to unwrap paragraphs - enable "keep paragraph breaks" so blank-line separations between paragraphs survive.

Frequently asked questions

How do I remove line breaks but keep my paragraphs?

Turn on the "keep paragraph breaks" option. The tool splits your text on blank lines into paragraphs, joins the wrapped lines inside each paragraph with your separator, and leaves the blank line between paragraphs intact so the structure is preserved.

What is the difference between CR, LF and CRLF?

LF (\n) is the Unix/Mac line break, CR (\r) is the classic Mac break, and CRLF (\r\n) is the Windows break. This tool treats each of the three as a single line break, so pasting Windows text never leaves a leftover carriage return.

How do I join lines without adding any space?

Set the separator to empty (the "nothing" option). Each line break is deleted and the lines are concatenated directly, so "abc\ndef" becomes "abcdef".

Can I replace line breaks with a comma or other character?

Yes. Choose the custom separator option and type any text - a comma, comma-space, pipe, or word. Every line break is replaced with exactly that string, which is handy for turning a vertical list into a delimited one.

Why do I get double spaces after removing line breaks?

If a line ended with a trailing space and you replace the break with another space, the two spaces sit next to each other. Enable "collapse multiple spaces" and every run of spaces and tabs becomes a single space.

Is my text uploaded to a server?

No. All processing runs entirely in your browser with JavaScript. Your text never leaves your device, so it is safe to paste private or sensitive content.

Sources & references

External references open in a new tab. We are independent and not affiliated with these organizations.

  • ✓ Free to use
  • ✓ No sign-up required
  • Runs entirely in your browser — nothing is uploaded.
  • ✓ Formula and method shown above

Provided “as is” for general information only — results may be inaccurate, so verify before you rely on them. No warranty; use at your own risk.

Built and reviewed by HIFreeTools against the formula shown above and any authoritative references cited on this page. See our methodology and editorial standards.

Related tools

Embed this tool on your site

Free to embed, no sign-up. Paste this code where you want the remove line breaks to appear: