Remove Line Breaks

A line break remover joins the lines of your text into one continuous block by replacing each line break with a space, a comma or nothing. Paste your text, choose what goes in place of the breaks, and copy the result. It can keep paragraphs and repair words split by a hyphen at the end of a line.

Runs in your browser. Your text is never uploaded.

How to use the remove line breaks

  1. Paste your text into the top box. The result appears underneath as you type or paste.
  2. Choose what should replace each line break. A space is right for ordinary text, a comma turns a list into one line, and Nothing joins the lines with no gap.
  3. Tick Keep paragraphs if the text has blank lines between paragraphs that you want to stay. Tick the hyphen option if the text came from a PDF or a printed column.
  4. Press Copy result to take the text away, or Download .txt to save it.

How line breaks are removed

The tool splits your text into lines, tidies each line and joins them again with the replacement you chose. It follows these steps in order.

  1. Find the breaks. A line break is any of the characters that end a line: the line feed and carriage return used by Windows, Mac and Linux, plus the less common vertical tab, form feed, next-line and Unicode line and paragraph separators.
  2. Tidy each line. Spaces at the start and end of every line are removed, and lines that are empty are dropped, so blank lines do not turn into double spaces.
  3. Join the lines. The remaining lines are joined with a space, a comma and a space, nothing, or your own text. With Keep paragraphs on, a blank line (or several) is treated as the end of a paragraph, the lines inside each paragraph are joined, and paragraphs stay apart with one empty line between them.
  4. Repair split words (optional). If a line ends with a letter and a hyphen, and the next line starts with a lowercase letter, the hyphen is removed and the two halves are joined with no gap, so “mem-” and “ory” become “memory”.
  5. Collapse spaces (optional). Runs of spaces and tabs inside the text are reduced to a single space.

The hyphen option cannot tell a word split by a printer from a real hyphenated word. “Well-” at the end of a line followed by “known” becomes “wellknown”, so read the result if your text contains many compound words.

Worked example

Text copied from a PDF often has a break at the end of every printed line and a split word. Here is the input, with ↵ marking each line break:

The study found that sleep affects mem-↵
ory more than expected. Participants↵
who slept eight hours scored higher.↵
↵
A second group slept less and↵
scored lower.

With the default settings (a space, no paragraphs, no hyphen repair), everything becomes one line and the split word stays split:

The study found that sleep affects mem- ory more than expected. Participants who slept eight hours scored higher. A second group slept less and scored lower.

With Keep paragraphs and the hyphen option on, the word is repaired and the blank line is kept:

The study found that sleep affects memory more than expected. Participants who slept eight hours scored higher.↵
↵
A second group slept less and scored lower.

Choosing A comma and a space turns a list of three lines (apples, bananas, cherries) into apples, bananas, cherries.

The options at a glance

OptionWhat it doesTypical use
A spacePuts one space where each break wasText copied from a PDF, email or web page
NothingJoins lines with no gapCodes, numbers or a long string split over lines
A comma and a spaceTurns a list into a comma-separated lineLists of names, tags or keywords
Custom textPuts your own text between the linesA pipe, a semicolon or a tab-like separator
Keep paragraphsJoins lines inside a paragraph, keeps blank-line gapsLong documents with several paragraphs
Join split wordsRemoves a hyphen at the end of a line when the next line continues the wordPDFs and scanned text
Collapse repeated spacesReduces runs of spaces and tabs to one spaceText with uneven spacing

Frequently asked questions

Why does text copied from a PDF have line breaks in the middle of sentences?

A PDF stores text as lines positioned on a page, not as flowing paragraphs. When you copy it, each printed line usually arrives with a break at its end. Removing the breaks makes the text flow again.

What is the difference between a line break and a paragraph break?

A line break ends a line, and a paragraph break is usually two line breaks in a row, which leaves a blank line. Turn on Keep paragraphs to remove the first kind and keep the second.

Why are some words stuck together in my result?

You probably chose Nothing as the replacement. With no space between the lines, the last word of one line and the first word of the next run together. Choose A space for normal text.

Does it remove spaces or other characters?

It removes spaces at the start and end of each line, drops empty lines and, if ticked, reduces repeated spaces to one. It never changes letters, numbers or punctuation, apart from the hyphen at the end of a line when you ask for split words to be joined.

Can I get my line breaks back?

Your original text stays in the top box and is never changed, so you can adjust the options or paste it again. Once you copy the result somewhere else, the breaks in that copy are gone.

Is my text uploaded or stored?

No. The line breaks are removed in your browser and your text never leaves your device.

Sources and references