Skip to content
Case Converter Online
en

Remove Line Breaks

Paste text with broken lines and get clean, flowing text back. Choose what goes between the joined lines and whether paragraphs stay apart.

Replace line breaks with
Options
Characters
0
Words
0
Lines
0

Runs in your browser. Your text is never uploaded.

What this tool does

A line break is the invisible character that ends a line and starts a new one. You add one each time you press Enter. Some text arrives with line breaks in the wrong places: every line copied from a PDF, quoted replies in old emails, text from a narrow web column, subtitles, or poems pasted into a field that should hold one line.

This tool removes those breaks and joins the lines back into normal sentences. You choose what replaces each break and whether paragraphs stay separate.

How to use it

  1. Paste your text into Text with line breaks.
  2. Under Replace line breaks with, choose A space, Nothing or A comma.
  3. Switch on Keep paragraph breaks if each paragraph should stay on its own line.
  4. Switch on Join words split by a hyphen for text from PDFs and books where long words were broken across lines.
  5. Remove double spaces is on by default, so lines that ended with a space do not leave a gap.
  6. Press Copy or Download to take the result.

The note under the tool says how many line breaks were removed.

Examples

Every result below came from this tool. The symbol ¶ marks a line break in the input column.

Input Setting Result
Dear team, ¶ the meeting moved ¶ to Friday. A space Dear team, the meeting moved to Friday.
apple ¶ banana ¶ cherry A comma apple, banana, cherry
ABC ¶ 123 ¶ XYZ Nothing ABC123XYZ
The results were in- ¶ conclusive at first. Join words split by a hyphen The results were inconclusive at first.

A longer case: the sample text on this page is two paragraphs copied from a PDF, seven lines in total. With default settings all six line breaks go and you get one long line. With Keep paragraph breaks switched on, four breaks are removed and the result is two clean paragraphs with a blank line between them:

This paragraph was copied from a PDF, so every line ends with a break that should not be there.

The second paragraph has the same problem.

How it works

The tool splits your text at every line break and trims spaces from the start and end of each line. Empty lines are dropped. The lines are then joined with the separator you picked. With Keep paragraph breaks on, the text is first split at blank lines, each paragraph is joined on its own, and the paragraphs are put back together with a blank line between them.

The hyphen option looks for a letter, a hyphen, a line break and then a lowercase letter. Only that pattern is joined, so “well-” at the end of a line followed by “Known” on the next stays as it is. A capital letter after the break usually means the hyphen is real.

Windows line endings (two characters) and old Mac line endings are handled the same way as normal ones.

Tips and limits

  • Check hyphenated words. A compound such as “self-” and “employed” split over two lines will be joined as “selfemployed” when the hyphen option is on. Read through the result if your text has many hyphenated terms.
  • Headings run into paragraphs. A PDF title with no full stop will join the first sentence. Add a full stop or a blank line after it before you paste.
  • Lists lose their shape. Joining with a space is right for prose, not for bullet lists. For lists, A comma gives a neater result.
  • Tabs and double spaces inside lines are not line breaks. Clean those with the whitespace remover.

Other ways to do it

Microsoft Word: open Find and Replace (Ctrl+H), type ^p in Find what and a space in Replace with, then press Replace All. To keep paragraphs, first replace ^p^p with a placeholder such as ###, then ^p with a space, then ### with ^p^p.

Excel and Google Sheets: for text inside one cell, =SUBSTITUTE(A1, CHAR(10), " ") replaces line breaks with spaces.

Code: in JavaScript, text.replace(/\s*\n\s*/g, ' ') does the basic job. In Python, ' '.join(text.split()) joins everything with single spaces.

Text copied from web pages often brings HTML tags or Markdown symbols with it. The text formatting remover strips those, and the plain text converter fixes curly quotes, fancy fonts and hidden characters.

Line Break Remover: questions and answers

How do I remove line breaks from text?

Paste the text into the Text with line breaks box. The Joined text box shows the same text on one line, with a space where each break was. Press Copy to use it.

Can I remove line breaks but keep paragraphs?

Yes. Switch on Keep paragraph breaks. Single line breaks inside a paragraph are removed, and the blank line between paragraphs stays, so you get one line per paragraph.

Why does text copied from a PDF have line breaks everywhere?

A PDF stores text as lines placed on a page, not as flowing paragraphs. When you copy it, each printed line ends with a hard line break. Pasting it into an email or a document keeps those breaks, which is why the text looks chopped up.

How do I turn a list into a comma separated line?

Paste the list with one item per line and choose A comma under Replace line breaks with. apple, banana and cherry on three lines become apple, banana, cherry.

What happens to words split with a hyphen at the end of a line?

Switch on Join words split by a hyphen. A word broken across two lines, such as in- at the end of one line and conclusive at the start of the next, is joined back into inconclusive.

More text tools

See all tools