WebzTools
Menu

Remove Line Breaks

Text copied out of a PDF, an email client or a terminal usually carries a hard line break at the end of every visual line. Paste it somewhere that wraps text on its own, such as a document, a web form or a spreadsheet cell, and the lines break in the wrong places. This tool replaces every line break in your text with a space, a comma, a semicolon, nothing at all or text of your own.

It treats every line break the same way. That makes it the right tool for flattening a single paragraph or turning a list into one line, and a blunt one for a document with several paragraphs, because the blank lines between paragraphs go along with the rest.

Runs in your browser. Remove Line Breaks processes your input on your own device. Nothing you enter or upload is sent to a server.

Did this tool help you? ☕

WebzTools is free to use. If this tool saved you some time, you can support the project with a coffee and help us keep improving the tools.

Buy Me a Coffee (opens in a new tab)

How to use the Remove Line Breaks

  1. Paste the text into the box.
  2. Choose what should replace each line break: a space, nothing, a comma and space, a semicolon and space, or custom text.
  3. Switch on Trim extra whitespace if you want doubled spaces and leftover gaps collapsed.
  4. Select Remove Line Breaks, then copy the result.

Supported formats: Plain text pasted into the box. Windows (CRLF), Unix and modern macOS (LF) and classic Mac (CR) line endings are all handled.

What each replacement option does

Trim extra whitespace is a separate switch. When it is on, every run of spaces, tabs and line breaks in the result is collapsed into one space and the ends are trimmed. It applies to the whole text, so deliberate double spaces and tab-aligned columns are flattened too.

OptionEach line break becomesGood for
SpaceA single spaceTurning wrapped lines back into flowing text.
Nothing (Remove)Nothing, so the last word of one line runs into the first word of the nextRejoining something that was wrapped mid-string, such as a long URL, a token or a number. Wrong for ordinary sentences.
Comma + SpaceA comma and a spaceTurning one item per line into a comma-separated list.
Semicolon + SpaceA semicolon and a spaceThe same, for systems that expect semicolons.
CustomWhatever you type in the custom boxA pipe, a tag, a separator of your own.

Example: text copied from a PDF

The same pasted text, two paragraphs wrapped at the width of a PDF page, joined with the Space option:

Space, Trim extra whitespace off

Input

The quick brown fox jumps
over the lazy dog and keeps
running.

A second paragraph starts
here.

Output

The quick brown fox jumps over the lazy dog and keeps running.  A second paragraph starts here.

Space, Trim extra whitespace on

Input

The quick brown fox jumps
over the lazy dog and keeps
running.

A second paragraph starts
here.

Output

The quick brown fox jumps over the lazy dog and keeps running. A second paragraph starts here.

Comma + Space, for a list

Input

apples
oranges
pears

Output

apples, oranges, pears
  • With Trim extra whitespace off, the blank line between the paragraphs becomes two spaces, one for each line break.
  • In both cases the two paragraphs are merged into one. That is expected: the tool has no way to tell a paragraph break from a wrapped line.

If you need to keep paragraphs

There is no paragraph-detection mode. If a document has several paragraphs, paste and clean one paragraph at a time, or join everything here and put the paragraph breaks back by hand where they belong.

Once the text flows again, paste it into the Word Counter to check its length, or use the Case Converter if it arrived in all capitals.

Things worth knowing

  • Words hyphenated across a line, such as 'inter-' at the end of one line and 'national' at the start of the next, are not rejoined. With the Space option you get 'inter- national'.
  • It only changes line breaks. It does not fix curly quotes, stray page numbers, headers or other debris that came along with the paste.

Frequently asked questions

Why does text copied from a PDF break at the end of every line?

A PDF stores text positioned line by line rather than as flowing paragraphs. When you copy it, each visual line usually comes across as a separate line of text, regardless of where sentences actually end.

Can I remove the line breaks but keep the paragraph breaks?

Not automatically. Every line break is replaced, including the blank lines between paragraphs, so paragraphs merge. Work through the text one paragraph at a time if you need them kept, or restore the breaks by hand afterwards.

Why does my result have double spaces?

A blank line is two line breaks in a row, and each one is replaced. Choosing Space therefore leaves two spaces where a paragraph break was. Switch on Trim extra whitespace to collapse them into one.

Is my text sent anywhere?

No. It is processed in your browser and is not sent to a server.

Browse all text tools