Skip to content
MoneyDeck

Remove Line Breaks

Fix text pasted from PDFs and emails by joining broken lines into paragraphs

Updated · Free, no signup

Turns "exam-" + "ple" on the next line into "example".

Cleaned text

Copying text from a PDF often leaves hard line breaks at the end of every line, which breaks the flow when you paste it elsewhere.

This tool joins those lines back into clean paragraphs.

Line breaks removed

4

Paragraphs in result

2

Characters before

187

Characters after

187

  • Removed 4 of 6 line breaks.

About the Remove Line Breaks

Text copied from a PDF, an email, a terminal or an old document often arrives with a hard line break at the end of every line. Pasted into a website, a Word document or a form, it looks ragged. This line break remover joins those lines back into flowing text in one click.

Choose whether to keep paragraph breaks (blank lines between paragraphs stay, single breaks inside a paragraph become spaces), turn everything into one continuous block, or delete breaks with no space at all — useful for re-joining long URLs, codes or base64 strings split across lines.

Optional clean-up collapses repeated spaces and tabs into a single space and re-joins words that were hyphenated across a line break ("exam-\nple" becomes "example"). The tool runs in your browser, so the text you paste stays on your device.

How to use the remove line breaks

  1. 1Paste the text that has unwanted line breaks.
  2. 2Choose to keep paragraphs, replace every break with a space, or delete breaks with no space.
  3. 3Leave "collapse extra spaces" on to tidy double spaces and tabs.
  4. 4Turn on hyphen re-joining for text copied from PDFs or justified columns.
  5. 5Copy the cleaned text into your document, email or form.

Formula and method

All line-break styles (Windows \r\n, classic Mac \r and Unix \n) are first normalised to \n. In "keep paragraphs" mode the text is split wherever a blank line appears; inside each paragraph single line breaks are replaced by a space, and the paragraphs are re-joined with one blank line between them. "Replace with a space" swaps every break for a space, and "no space" deletes breaks entirely.

With collapsing on, runs of spaces and tabs become a single space and each paragraph is trimmed. Hyphen re-joining removes a hyphen that sits directly before a line break between two letters. Counts compare the number of line breaks and characters before and after.

Worked examples

PDF text with two paragraphs

The sample has 6 line breaks: 3 inside the first paragraph, 2 forming the blank line, and 1 inside the second paragraph. Keeping paragraphs replaces the 4 in-paragraph breaks with spaces and keeps the blank line, giving 2 clean paragraphs.

Address lines into one line

Each of the 3 line breaks is replaced by one space, so the character count stays at 47 while the address becomes a single line you can paste into a one-line form field.

Re-join a split code with hyphenation fix

Hyphen re-joining turns "inter-" plus "national" into "international". The "no space" mode then deletes the remaining 2 breaks without adding spaces, which is right for split codes (AB12CD34) though it also glues ordinary words together — use space mode for prose.

Frequently asked questions

How do I remove line breaks but keep paragraphs?+

Choose "Keep paragraphs, join lines inside them". Single line breaks become spaces, while blank lines between paragraphs are preserved as paragraph breaks.

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

PDFs store text as positioned lines rather than flowing paragraphs, so copying usually inserts a hard break at the end of each visual line. Joining the lines restores normal flowing text.

How do I remove line breaks in Word or Excel instead?+

In Word, use Find and Replace with ^p (paragraph mark) or ^l (manual line break) and replace with a space. In Excel, use =SUBSTITUTE(A1,CHAR(10)," "). This tool does the same without formulas.

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

A line break (\n) starts a new line; a paragraph break is usually two line breaks — an empty line — separating blocks of text. This tool treats one or more blank lines as a paragraph break.

Will hyphen re-joining break real hyphenated words?+

It only removes a hyphen that sits immediately before a line break. A compound like "well-known" that happens to be split at the hyphen would become "wellknown", so review the result or leave the option off.

Related tools