ToolNimba Browse

Remove Line Breaks Tool

By ToolNimba Text Team · Updated 2026-06-19

Replace each line break with
Options
0
Line breaks removed
0
Characters in
0
Characters out

Paste some text above to remove its line breaks.

When you copy text out of a PDF, an email or a chat window, it often arrives broken into short lines with a hard line break at the end of each one. Paste that into a document or a form and the ragged wrapping comes with it. This tool removes those line breaks for you. Paste your text, choose whether each break becomes a single space or disappears entirely, optionally keep the blank lines that separate paragraphs, and copy the clean result.

What is the Remove Line Breaks?

A line break is an invisible control character that tells software to move to the next line. There are three common kinds: the line feed (LF, written as \n) used on Linux and macOS, the carriage return (CR, \r) used on classic Mac OS, and the carriage return plus line feed pair (CRLF, \r\n) used on Windows. A single visible "new line" in your text may be any one of these, which is why a paragraph copied from a PDF can look fine on screen yet refuse to flow neatly when you paste it. This tool normalises all three styles first, so it treats every break the same way no matter where the text came from.

Removing line breaks is not the same as removing spaces. A line break separates one line from the next, while a space separates words on the same line. When you delete a break you usually want a space in its place so the last word of one line does not collide with the first word of the next, turning "the quick\nbrown fox" into "the quickbrown fox" by mistake. That is why the default here replaces each break with one space. Choose the "nothing" option only when the lines should join with no gap, for example a long code, hash or URL that was wrapped across lines.

Paragraph breaks deserve special handling. In most pasted text a single line break is just wrapping inside a paragraph, while a blank line (two breaks in a row) marks the start of a new paragraph. Keeping paragraph breaks lets you flatten the wrapping inside each paragraph while preserving the structure between them, which is exactly what you want when cleaning an article or a multi-paragraph email. Turn the option off to collapse everything into one continuous block.

When to use it

  • Cleaning text copied from a PDF, where every visible line ends in a hard line break.
  • Flattening a quote or paragraph before pasting it into a single form field or spreadsheet cell.
  • Joining a code snippet, hash, token or URL that was wrapped across several lines.
  • Preparing copy for a CMS or social post where stray newlines would break the layout.
  • Merging a bulleted or numbered list back into running prose.

How to use the Remove Line Breaks

  1. Paste or type the text with unwanted line breaks into the input box.
  2. Choose whether each line break becomes a single space or nothing at all.
  3. Tick "Keep paragraph breaks" if you want blank lines between paragraphs preserved.
  4. Adjust the optional collapse-spaces, trim and convert-tabs settings if needed.
  5. Read the cleaned text in the result box and click Copy to use it elsewhere.

Formula & method

The tool normalises every CRLF (\r\n) and CR (\r) to a line feed (\n), then replaces each \n with either one space or an empty string. With paragraph breaks kept, runs of two or more newlines are preserved as a blank line and only the single newlines inside each paragraph are replaced.

Worked examples

You copy three lines from a PDF: "The quick" then "brown fox" then "jumps over." and want one clean line.

  1. Input has 2 line breaks: The quick\nbrown fox\njumps over.
  2. Set the mode to "A single space".
  3. Each \n is replaced by one space.
  4. Result: The quick brown fox jumps over.
  5. Line breaks removed: 2

Result: The quick brown fox jumps over.

A long download token was wrapped across two lines: "ABC123" then "XYZ789" and must join with no gap.

  1. Input: ABC123\nXYZ789 (1 line break).
  2. Set the mode to "Nothing (join directly)".
  3. The single \n is removed with no space inserted.
  4. Result: ABC123XYZ789
  5. Line breaks removed: 1

Result: ABC123XYZ789

A two-paragraph email has wrapping inside each paragraph but you want to keep the gap between paragraphs.

  1. Input: line one\nline two\n\nline three\nline four
  2. Leave "Keep paragraph breaks" ticked, mode set to a single space.
  3. Single newlines inside each paragraph become spaces.
  4. The blank line (two newlines) stays as a paragraph break.
  5. Result: line one line two\n\nline three line four

Result: Two clean paragraphs, each on its own line, separated by one blank line.

Line break characters and where they come from

NameSymbolCodeTypical source
Line feedLF\nLinux, macOS, most web text
Carriage returnCR\rClassic Mac OS (pre-2002)
CR + LFCRLF\r\nWindows files, many emails
Paragraph breakblank line\n\nGap between paragraphs

Which replacement option to choose

Your textReplace break withWhy
Wrapped prose or a quoteA single spaceKeeps words from running together
A list you want as a sentenceA single spaceJoins items into running text
A code, hash or tokenNothingNo gap should appear between parts
A wrapped URLNothingA space would break the link

Common mistakes to avoid

  • Joining lines with nothing when you needed a space. Choosing "Nothing" on ordinary prose glues the last word of one line to the first word of the next, like "quickbrown". For sentences and paragraphs, replace each break with a single space instead.
  • Flattening paragraphs you meant to keep. Turning off "Keep paragraph breaks" merges an entire multi-paragraph passage into one block. Leave the option on when the blank lines between paragraphs carry meaning.
  • Forgetting about Windows carriage returns. Text from Windows files uses CRLF, so a single visible break is really two characters. The tool normalises these automatically, but pasting into a tool that does not can leave stray \r characters behind.
  • Leaving double spaces after the join. If lines already ended in a trailing space, replacing the break with another space creates double spaces. Keep the "Collapse multiple spaces" option on to tidy these up.

Glossary

Line break
An invisible control character that moves following text to a new line.
Line feed (LF)
The \n character used to mark a new line on Linux, macOS and most web text.
Carriage return (CR)
The \r character, once used alone on classic Mac OS and paired with LF on Windows.
CRLF
The two-character sequence \r\n that Windows and many email systems use for a line break.
Paragraph break
A blank line, made of two line breaks in a row, that separates one paragraph from the next.
Trim
Removing whitespace from the start and end of a line or the whole text.

Frequently asked questions

How do I remove line breaks from text?

Paste your text into the input box, then choose whether each line break becomes a single space or nothing. The cleaned text appears instantly in the result box and you can copy it with one click. Everything runs in your browser, so your text is never uploaded.

Should I replace line breaks with a space or with nothing?

For ordinary sentences and paragraphs, replace each break with a single space so words do not run together. Choose "nothing" only when the lines should join with no gap, such as a long code, hash or URL that was wrapped across lines.

Can I keep the blank lines between paragraphs?

Yes. Leave the "Keep paragraph breaks" option ticked and the tool preserves blank lines while still flattening the wrapping inside each paragraph. Turn it off to collapse the whole passage into one continuous block.

Does it handle text copied from a PDF or Windows file?

Yes. The tool first normalises Windows carriage returns (CRLF) and classic Mac returns (CR) to a single line feed, so it treats every break the same way no matter what device or program the text came from.

Is my text sent to a server?

No. The tool works entirely in your browser using plain JavaScript. Nothing you paste leaves your device, which makes it safe for confidential notes, emails and documents.

Why does my result have double spaces after removing breaks?

That happens when the original lines ended in trailing spaces and a break was replaced with another space. Keep the "Collapse multiple spaces to one" option on, and optionally "Trim", to clean those up automatically.