usefmtly

Remove Line Breaks

Remove Line Breaks — Free online tool to remove line breaks from text. Replace newlines with a space, nothing, or a custom separator. Collapse multiple spaces. Instant, client-side, no signup.

0Input chars
0Output chars
0Line breaks
SpaceMode
Input
Output

How to remove line breaks

  1. Paste your text into the input box on the left. Line breaks are processed instantly as you type or paste.
  2. Choose a replacement modeSpace joins lines with a space (creating a single paragraph), Nothing removes the line break entirely (concatenating words), or Custom lets you specify a separator like | or , .
  3. Toggle Collapse spaces if you want multiple consecutive spaces reduced to one — useful when text already had trailing spaces before the line break.
  4. Copy the output using the copy button at the top right of the output panel.

When to use this tool

Pasting into single-line inputs

Many forms, spreadsheet cells, and search fields reject multi-line text. Strip line breaks to make the text compatible.

Cleaning up PDF copies

Text copied from PDFs often includes hard line breaks at every wrapped line. Remove them to get flowing paragraphs.

Joining list items into a sentence

Convert a newline-separated list into a comma-separated sentence with the custom separator option.

Preparing text for APIs

Some APIs and JSON strings need single-line values. Remove line breaks before encoding your content.

Email subject line cleanup

Copied subject lines from PDFs or documents may include unwanted breaks. Clean them in one click.

Concatenating code strings

Turn multi-line SQL, markdown, or template text into a single quoted string for programmatic use.

What are line breaks?

A line break (also called a newline) is the invisible character that moves text to the next line. When you press Enter in a text editor, you insert a line break.

There are two common formats: LF (Line Feed, \n) used on Unix/Linux/macOS, and CRLF (Carriage Return + Line Feed, \r\n) used on Windows. This tool handles both automatically.

Related tools: Text Cleaner for broader text cleanup, Duplicate Line Remover to deduplicate lists, or the Word Counter to count words in your result.

Frequently Asked Questions

What does this tool do?

It removes or replaces line breaks in pasted text so you can turn a messy copy from a PDF, email, or document into something usable. You can join every line with a space, strip the breaks entirely, or swap them for a custom separator such as " | ", a comma, or a dash. That makes it handy for cleanup without sending your text to a server.

What kinds of line breaks does it handle?

It handles the common newline formats you run into on the web and in desktop apps: Unix LF (\n), Windows CRLF (\r\n), and older CR-only line endings. That means pasted text from Notepad, Word, Google Docs, emails, PDFs, and terminals all gets normalized the same way instead of leaving weird gaps behind.

When would I need to remove line breaks?

Use it when content was wrapped visually but should read as one sentence or paragraph: form fields that reject newlines, copied text from PDFs with one word per line, exported notes that need to become a list, or spreadsheet cells that need a single continuous value. It is also useful when you want cleaner text for JSON, CSV, or prompt inputs.

How do I keep paragraph breaks while cleaning up text?

If you need to preserve some structure, choose a custom separator instead of deleting everything outright. For example, replacing line breaks with a double newline keeps paragraphs visually separated, while a slash, bullet, or pipe can make lists easier to scan. If the source has true blank-line paragraph breaks, clean those separately so you do not flatten the entire document by accident.

Related Tools