How to use the Remove Line Breaks
Remove line breaks and join text in three steps:
1
Paste your text
Paste multi-line text into the input area. Both Windows (CRLF) and Unix (LF) line endings are detected automatically.
2
Choose replacement and options
Select what replaces each line break: Space (default), Nothing, Comma+Space, Pipe, or Custom. Enable 'Preserve paragraph breaks' to only join single line breaks, keeping blank-line paragraph separators intact.
3
Convert and copy
Click 'Remove Line Breaks' and copy or download the joined output.
When to use this tool
Use to join broken lines into continuous text for further processing:
- →Joining text copied from a PDF where lines break mid-sentence at the page margin
- →Combining a multi-line postal address into a single line for passing to an API or database field
- →Removing newlines from JSON string values that were formatted across multiple lines
- →Joining a multi-line shell command or SQL query into a single executable line
- →Cleaning up email text that was hard-wrapped at 72 or 80 characters before quoting it in a document
- →Merging multi-line error messages or stack traces into a single line for logging or ticket submission
Frequently asked questions
Q:Why should I replace line breaks with a space instead of nothing?
When lines break mid-sentence in a PDF or email, there is no space between the last character of one line and the first character of the next. Replacing the line break with a space ensures words from adjacent lines are separated correctly (e.g. 'the quick' + newline + 'brown fox' becomes 'the quick brown fox'). Replacing with nothing would produce 'the quickbrown fox'. The space replacement is the default for this reason.
Q:What does 'Preserve paragraph breaks' do?
When enabled, the tool only removes single line breaks (lines separated by one newline) and joins them with the chosen replacement. Double newlines (blank lines that separate paragraphs) are kept intact. This is ideal for cleaning up PDF text where lines within paragraphs are broken but paragraph boundaries should be preserved for readability.
Q:Does it handle Windows (CRLF) and Unix (LF) line endings?
Yes — both \r\n (Windows/CRLF) and \n (Unix/LF) line endings are detected and removed. The tool normalises mixed line endings too, so a file with inconsistent CRLF and LF endings is handled correctly in a single pass.
Q:Can I join lines with a custom delimiter other than space or comma?
Yes — select 'Custom' from the replacement options and type any string into the custom input field. You can use multi-character strings, punctuation, or any other text as the delimiter that replaces each line break.
Q:How is this different from Remove Empty Lines?
Remove Line Breaks joins lines that have content by replacing the newline between them with a space or other character, reducing many lines to one. Remove Empty Lines specifically targets blank lines between content lines and either deletes them or collapses multiple blanks into one, while leaving the content lines themselves on their own separate lines. Use Remove Line Breaks to flatten text; use Remove Empty Lines to clean up spacing between paragraphs.
Q:Can I use a pipe character to join lines for Markdown or table formatting?
Yes — select the Pipe ( | ) replacement option to join lines with a pipe character, which is the column separator in Markdown tables. This is useful if you have table data on separate lines that you need to join into a single pipe-delimited row.