My Tool Studio
Text

Remove Line Breaks

Paste text copied from a PDF, email or chat and this tool will remove line breaks, joining the broken lines back into flowing text. PDF text is the usual reason: each printed line ends with a hard break, so a pasted paragraph arrives chopped every ten or twelve words. By default every line is joined into one paragraph with single spaces. You can keep paragraph breaks, replace each line break with a comma, semicolon, period or your own text, and rejoin words that the PDF split with a hyphen at the end of a line. Kept paragraphs can be capitalized, given a closing period or indented. A counter shows how many line breaks were removed. Students pasting quotes, marketers moving copy between tools and anyone flattening a list into one spreadsheet cell get clean text back in a second, without it leaving the browser.

Always freeNo sign upRuns in your browser

How to use

01

Paste the broken text

Paste into the Text with line breaks box, or press Try sample to see PDF-style text with a word split by a hyphen and a paragraph gap.

02

Choose how lines are joined

In Replace each line break with, pick A space, a comma, semicolon, period, spaced hyphen, Nothing or Custom text. Tick Keep paragraph breaks to keep blank lines, and leave the hyphen option on for PDF text.

03

Check and copy the result

The Joined text pane updates as you type, and the counter shows how many line breaks were removed. Press Copy when the text reads correctly.

Why Remove Line Breaks

Before and after: text copied from a PDF

This is the sample text as it arrives from a PDF. The first paragraph is split across three lines, and the word sentence is broken with a hyphen. A blank line separates it from the second paragraph.

With the default settings, all six lines become one paragraph: "Text copied from a PDF often breaks in the middle of a sentence, because each printed line ends with a hard line break. A blank line marks the start of a new paragraph, which you can keep or join as well." The counter reports 5 line breaks removed.

With Keep paragraph breaks ticked, the two paragraphs stay separate and only 3 line breaks are removed. If you untick the hyphen option, the first paragraph reads sen- tence, which is why the option is on by default.

Removing line breaks in Word and Excel

If you would rather fix the text where it is, these steps work in common programs. Word shows a paragraph mark for Enter and a bent arrow for Shift+Enter when you click the Show/Hide button on the Home tab, which tells you which kind of break you are dealing with.

  • Word: press Ctrl+H. In Find what, type ^p for paragraph marks or ^l for manual line breaks, and replace with a space.
  • Word, keeping paragraphs: first replace ^p^p with a placeholder such as ###, then replace ^p with a space, then replace ### with ^p.
  • Excel or Google Sheets: =SUBSTITUTE(A1,CHAR(10)," ") returns the cell text with line breaks turned into spaces.
  • Excel Find and Replace: press Ctrl+J in the Find what box to search for a line break, then replace it with a space or a comma.

Common questions

How do I remove line breaks but keep paragraphs?
Tick Keep paragraph breaks (blank lines). Single line breaks inside a paragraph are joined, while a blank line between paragraphs stays as a paragraph break. This only works when your source has blank lines between paragraphs. Once it is ticked you can also separate paragraphs with a single line break, capitalize their first letter, add a missing period or indent them with a tab.
How do I remove line breaks from text copied from a PDF?
Paste the text, keep A space as the joiner and leave Rejoin words split by a hyphen at the line end ticked. Broken sentences are joined and words like sen- tence become sentence. Tick Keep paragraph breaks if the pasted text has blank lines between paragraphs.
How do I replace line breaks with commas?
Choose Comma and space in the Replace each line break with menu. A list with one item per line becomes apple, banana, cherry on a single line. Semicolon and space and Period and space are in the same menu. For a comma with no space, pick Custom text and type it.
Does the hyphen fix ever join words it should not?
It can. The option joins a letter, a hyphen at the very end of a line and a lowercase letter on the next line. A real compound word that happened to break at its hyphen, like well- known, becomes wellknown. Untick the option if your text has many such words.
What is the difference between a line break and a paragraph break?
A line break ends a line and starts the next one inside the same paragraph. A paragraph break starts a new block, and in plain text it is usually shown as a blank line, meaning two line breaks in a row. In Word, Shift+Enter makes a line break and Enter makes a paragraph break.
What happens to extra spaces and tabs when line breaks are removed?
With Collapse extra spaces and tabs ticked, which is the default, runs of spaces and tabs inside each line become one space and line ends are trimmed before joining. Untick it to keep every space and tab exactly as it was, for example when joining lines of a tab-separated row.
How do I remove line breaks in Excel?
Use =SUBSTITUTE(A1,CHAR(10)," ") to replace line breaks inside a cell with spaces. You can also open Find and Replace, press Ctrl+J in the Find what box to enter a line break, and replace it with a space. Or paste the cell text here and copy it back.
Can I join lines with no space at all?
Yes. Choose Nothing and lines are joined directly, which suits long codes, keys or Base64 strings that were wrapped across lines. With Collapse extra spaces and tabs on, spaces at the ends of each line are trimmed first.
Does removing line breaks change my words or punctuation?
No. Only line breaks and whitespace are changed, plus the hyphen fix if it is on. Letters, numbers, punctuation and capitals come through as they were.
Is text uploaded when I remove line breaks online?
No. The joining happens in your browser, so nothing is sent to a server. You can paste confidential documents safely.

More Text tools

View all