Skip to content
ToolPlankDEV
Text Tools
100% In-Browser Execution

Updated:

Remove Line Breaks from Text

Paste your text to remove line breaks in one step. Join every line, or keep the paragraph breaks. Replace each break with a space, comma or nothing, and repair words that a PDF split with a hyphen. Nothing is uploaded.

Options:

Your text

Input
0 chars · 0 lines

Text without line breaks

Ready
Processing in browser...
0 chars · 0 linesUpdates as you type

Processed on your device. Your text is not sent to our servers.

More free tools you may need next.

Quick Guide

How to use Remove Line Breaks

Simple step-by-step instructions to get the exact output you need.

  1. 01

    Paste your text

    Paste the text into the Your text box, press Paste to read the clipboard, or drop a .txt file onto the box. Press Example to load a short text that was wrapped at the end of each line, with a split word in it.

  2. 02

    Choose what to remove

    Remove set to All line breaks turns the whole text into one block. Keep paragraphs joins the lines inside each paragraph and keeps one blank line between paragraphs.

  3. 03

    Choose what goes between the lines

    Replace with sets what is put where each break was: a space, nothing, a comma, a semicolon, a pipe or a tab. Trim each line and Collapse extra spaces tidy up the spaces. Join split words repairs words that were broken with a hyphen.

  4. 04

    Copy the result

    The text without line breaks updates as you type. Press Copy, or Download to save a .txt file. Your original stays in the first box.

How to Remove Line Breaks from Text

To remove line breaks, paste the text and read the result. With the default settings every line is joined to the next with a single space, blank lines are dropped, and spaces at the edges of each line are trimmed. This is the Example text after it goes through the tool:

Text
The quick brown fox jumps over the lazy dog. This is the first paragraph of the sample. A second para- graph was split by a hyphen at the end of a line.

The result is one block, which is what you want when a form field, a spreadsheet cell or a message box does not accept line breaks. Notice that the word para-graph is still split. That has its own option, described below.

Keep Paragraphs and Remove Only the Line Breaks Inside Them

Text copied from a PDF or an email is often wrapped at a fixed width. Every line ends with a break, even in the middle of a sentence, but the paragraphs are still separated by a blank line. Setting Remove to Keep paragraphs joins the wrapped lines and keeps the blank line between paragraphs. The Example text then becomes two paragraphs:

Text
The quick brown fox jumps over the lazy dog. This is the first paragraph of the sample.

A second para- graph was split by a hyphen at the end of a line.

A line that contains only spaces counts as blank, so it still separates two paragraphs. Several blank lines in a row are reduced to one. To only delete blank lines and keep every other line break, use Remove Empty Lines. To do the opposite and wrap long lines at a width such as 72 or 80, use Word Wrap.

Replace Line Breaks with a Space, Comma or Nothing

A space is the right choice for ordinary text. Other separators suit other jobs:

  • Nothing: joins the lines with no gap. Use it for codes, IDs and keys that were wrapped, or for text that was split in the middle of a word.
  • Comma and space: turns a list with one item per line into a single line, for example apple, banana, cherry.
  • Semicolon and space, pipe or tab: for importing into tools that expect those separators.

A list of items joined this way can still have repeats. Remove Duplicate Lines cleans those up first. If you need the line breaks kept but written as the two characters backslash and n, for example inside JSON, use JSON Escape.

Fix Text Copied from a PDF, Email or Terminal

Three options help with wrapped text. Trim each line removes the spaces that some programs add at the end of a line, so they do not pile up after joining. Collapse extra spaces turns two or more spaces in a row into one. Join split words repairs hyphenation. If you want to tidy the spaces but keep every line where it is, including tabs and the non-breaking spaces that PDFs add, use the Space Remover instead.

Join split words works when a line ends with a letter followed by a hyphen and the next line starts with a lowercase letter. Then the hyphen and the break are removed, so para- and graph become paragraph. The rule is deliberately narrow. A line ending in a hyphen before a capital letter, such as Anglo- and Saxon, is left alone.

What Counts as a Line Break

Different systems end a line in different ways, and the tool treats all of them as line breaks:

  • Line feed, written as LF or \n: used by Linux, macOS and most web content. This is the one called new line.
  • Carriage return plus line feed, CRLF or \r\n: used by Windows files.
  • Carriage return alone, CR or \r: found in some older files.
  • Vertical tab and form feed: the form feed is the character behind many page breaks in plain text.
  • The Unicode next line, line separator and paragraph separator characters.

So the tool can remove carriage returns, remove line feeds, remove the end of every line and remove page breaks from text in one step. If characters you cannot see are still left after the cleanup, the Invisible Character Remover lists them.

Removing Line Breaks in Word or Excel

You can paste the text from Word or Excel into this tool, remove the breaks and paste the result back. Both programs also have their own ways. In Word, Find and Replace can search for the paragraph mark, typed as ^p, and the manual line break, typed as ^l. In Excel, a formula such as =SUBSTITUTE(A2,CHAR(10)," ") replaces the line breaks in a cell with spaces. If you only need to change the case of a column, the Excel Case Converter works on whole files.

Limits and Things to Know

  • The tool changes only line breaks and the spaces around them. It does not fix spelling, punctuation or capital letters.
  • In All line breaks mode, blank lines are dropped and never create extra separators.
  • Input is limited to 2,000,000 characters.

Your text is processed by code running in your browser. It is not sent to a server and not stored. See the Privacy Policy for details.

Frequently Asked Questions

Technical Q&A for Remove Line Breaks

Common questions about edge cases, character encoding, and privacy guarantees.

Paste the text into the box. The result on the right has the line breaks replaced by a space. Press Copy to use it.

Set Remove to Keep paragraphs. Lines inside a paragraph are joined, and one blank line stays between paragraphs.

Yes. Set Replace with to Comma and space. A list with one item per line becomes a single line such as apple, banana, cherry.

Set Replace with to Nothing. The lines are joined directly, which suits wrapped codes and IDs.

Paste the text. Line feeds (LF), carriage returns (CR) and CRLF pairs are all treated as line breaks and removed in the same step.

Use Keep paragraphs so that the paragraphs survive, tick Trim each line, and tick Join split words if the PDF broke words with a hyphen.

Paste the text. Form feed characters, which plain text uses for page breaks, are treated as line breaks and are removed along with the rest.

Replace with is set to a space by default. Choose Nothing if you want no gap, and keep Collapse extra spaces on so that you never get double spaces.

It can trim the spaces at the ends of each line and collapse runs of spaces, and both can be switched off. It never changes words, punctuation or capital letters, except that Join split words removes a hyphen at a line end.

No. The text is processed in your browser and nothing is sent to a server or saved. Reloading the page clears it.