Skip to content

Remove Line Breaks

Paste text that breaks at the end of every line, as it does when copied from a PDF, an email or a web page, and the line breaks come out as you choose: only the single ones inside paragraphs, every one, or all but the paragraph breaks. The result updates as you type, with a count of the breaks removed. Free, no sign-up, and nothing is uploaded.

Options

Mode

0 line breaks detected

How to Use the Line Break Remover

  1. Paste your text. The cleaned version appears straight away in the second box, with the number of line breaks detected and removed.
  2. Pick a mode. Single line breaks only is the default and suits most copied prose. Preserve paragraphs also tidies each paragraph. All line breaks gives you one unbroken block.
  3. Decide what replaces each break. The box is ticked by default, so a space goes where each break was and words on neighbouring lines stay apart. Untick it only when you want the lines glued together with nothing between them.
  4. Copy the result. Use Copy to Clipboard, then paste it into your document.

The Three Modes, Compared

A paragraph break is two or more line breaks in a row, a blank line. The three modes treat it differently. The sample below was copied from a PDF with a break at the end of every printed line and one blank line between its two paragraphs, so it contains five line breaks:

Pasted

Sleep is essential for memory\nconsolidation. During deep sleep,\nthe brain replays the day.\n\nA second paragraph starts\nhere.

Single line breaks only (3 removed)

Sleep is essential for memory consolidation. During deep sleep, the brain replays the day.\n\nA second paragraph starts here.

All line breaks (5 removed)

Sleep is essential for memory consolidation. During deep sleep, the brain replays the day. A second paragraph starts here.

In the examples, \n marks a line break. Single line breaks only and Preserve paragraphs give the same result on this sample. They differ on untidy input: Preserve paragraphs also trims each paragraph, drops empty ones, and reduces a run of three or more breaks to a single blank line, where the single-breaks mode leaves such runs as they are.

Things the Tool Does Not Fix

  • Hyphenated line ends. PDFs often split a word at the end of a line. "docu-" on one line and "ment" on the next becomes "docu- ment" with the default space, or "docu-ment" if you untick the replacement box. Either way the hyphen stays and you delete it by hand.
  • Extra spaces. In every mode, runs of two or more spaces or tabs are collapsed to one, including intentional indents and any aligned columns. If you need those spaces, keep a copy of the original.
  • Page numbers, headers and footnotes. They arrive as ordinary lines of text and are joined into the sentence around them. Delete them first; the Line Filter can remove every line that contains a given word or pattern.
  • Invisible characters. Soft hyphens and no-break spaces from PDFs and web pages survive, and can break searches. Check for them with the Hidden Character Detector.

Which Tool Do You Need?

If you want…Use
Wrapped lines joined back into paragraphsThis Line Break Remover
Double spaces, tabs or blank lines removedExtra Space Remover
Lines split by sentence, width or a separatorAdd Line Breaks
Whole lines deleted because they contain a wordLine Filter
Timestamps and filler words stripped from a transcriptTranscript Cleaner

Frequently Asked Questions

Why does text copied from a PDF have a line break on every line?
A PDF is a picture of a page, not a flowing document. It stores each printed line as its own piece of text, so copying it gives you a hard return at the end of every line. Removing the single breaks while keeping the blank lines between paragraphs rebuilds the paragraphs.
Should I replace line breaks with a space or with nothing?
With a space for ordinary prose, because otherwise the last word of one line fuses with the first word of the next ("memoryconsolidation"). Replace with nothing only when the lines are fragments of one long string, such as a wrapped URL, an account number or a line of code.
How do I remove line breaks but keep the paragraphs?
Use Single line breaks only or Preserve paragraphs. Both remove the breaks inside paragraphs and leave the blank lines between them, so the paragraph structure is kept. The All line breaks mode removes the paragraph breaks too.
Does it remove the extra spaces too?
It collapses runs of two or more spaces or tabs into a single space in every mode, which is usually what you want after a copy from a PDF. For full control of spaces and blank lines, use the Extra Space Remover.
Can I use it on text copied from Word or Google Docs?
Yes. A manual line break (Shift+Enter) and a paragraph mark both arrive as line breaks when you paste, so All line breaks flattens everything and the other modes keep the paragraphs. Formatting such as bold and italics is lost, because the tool works on plain text.
Is my text uploaded or stored?
No. The cleaning runs in your browser as you type, nothing is sent to a server, and closing the tab clears the text.

Related Tools

More in Text Cleanup & Formatting

See all Text Cleanup & Formatting