Skip to main content
TextReverse

Remove Line Breaks

Paste text that was copied out of a PDF, a plain-text email or a terminal and get it back without the hard line breaks. Choose one continuous line, or keep the blank lines between paragraphs.

Text copied from a PDF carries a line break wherever the page happened to wrap, which is why it arrives in a chat box or a document as a ragged column. This tool removes those breaks, trims the stray spaces they leave behind and drops empty lines, so the text reads the way it was written.

Text copied from a PDF breaks at the end of every printed line.Text copied from a PDF breaks at the end of every printed line.

Want the line order flipped instead? Reverse lines

Transformation mode
Try an example
0 characters0 words0 lines
Output
Example: “This sentence was copied from a PDF and broke at every line of the page.” becomesThis sentence was copied from a PDF and broke at every line of the page.
0 characters0 words0 lines
Ctrl + Enter Copy resultEsc Clear

Line Break Removal Examples

Each output below is produced by the same code as the tool. The last rows use Keep paragraphs, which joins lines but leaves a blank line between paragraphs.

InputOutputWhat it shows
This sentence was copied from a PDF and broke at every line of the page.This sentence was copied from a PDF and broke at every line of the page.The basic case: three wrapped lines become one sentence.
Hi Sam, Thanks for the notes. I will send the draft on Friday.Hi Sam, Thanks for the notes. I will send the draft on Friday.One-line mode joins everything, including the greeting.
apples bananas cherriesapples bananas cherriesA list becomes space-separated words on one line.
line one line twoline one line twoSpaces left at the start and end of each line are trimmed, so no double gap appears at the join.
first second thirdfirst second thirdWindows CRLF endings are removed cleanly with no stray carriage returns.
First paragraph, wrapped across two lines. Second paragraph, also wrapped.First paragraph, wrapped across two lines. Second paragraph, also wrapped.Keep paragraphs: lines inside each paragraph join, and the blank line between paragraphs stays.
One TwoOne TwoSeveral blank lines in a row collapse to a single paragraph break.
a hyphen- ated worda hyphen- ated wordHyphens are kept as typed. A word split with a hyphen at a line end needs a manual fix.

How the Line Break Remover Works

Removing line breaks sounds like a single find-and-replace, but a naive replace leaves double spaces and empty gaps behind. These are the steps the tool takes instead.

Every kind of line ending is recognised

Windows uses a carriage return plus a line feed (CRLF), older Mac files use a lone carriage return and everything else uses a line feed. All three count as one break, so text from any system is handled the same way.

Each line is trimmed before joining

Wrapped text often carries a space at the end of one line or indentation at the start of the next. Trimming both ends of every line means each break is replaced by exactly one space.

Empty lines are dropped

In one-line mode, blank lines carry no text, so they are removed rather than turned into extra spaces. Use Keep paragraphs if those blank lines mark paragraphs you want to keep.

Keep paragraphs splits on blank lines first

Any run of two or more line breaks, even with spaces between them, is treated as a paragraph break. The lines inside each paragraph are joined, then the paragraphs are put back together with one blank line between them.

One Line, Keep Paragraphs or Reverse Lines?

Three ways to deal with a multi-line block. The same two short paragraphs show what each one does.

Shared input: Notes copied from a wrapped PDF page. A second short paragraph.

TransformationResultReach for it when
One lineNotes copied from a wrapped PDF page. A second short paragraph.You are pasting into a single-line field, a spreadsheet cell or a search box.
Keep paragraphsNotes copied from a wrapped PDF page. A second short paragraph.You want readable paragraphs back in a document or email.
Reverse linesparagraph. A second short wrapped PDF page. Notes copied from aYou want to keep every line but flip their order, such as a log or a list.

Things to Check After Removing Line Breaks

The tool only removes breaks. It does not rewrite your text, so a few artefacts from the source document can survive the join.

Hyphenated line ends stay hyphenated

A PDF that split "information" as "infor-" and "mation" comes back as "infor- mation". Removing the hyphen automatically would also break genuine hyphenated words, so the tool leaves it alone. Search the output for "- " to find them.

Lists lose their structure

A bulleted or numbered list joined into one line reads as one long run of items. If you only want the list in a different order, reverse lines keeps every line intact.

Single-line paragraphs need a blank line to survive

Keep paragraphs relies on blank lines. If the source puts each paragraph on its own line with no gap, there is no way to tell a paragraph break from a wrap, so both get joined.

Spaces inside a line are not touched

Only the whitespace at line ends is trimmed. Double spaces or tabs in the middle of a line pass through unchanged, so the tool never alters text that was not caused by a line break.

Where Unwanted Line Breaks Come From

The breaks are rarely in the original writing. They are added by the program that displayed or exported the text.

PDF files

A PDF stores text line by line as it was laid out on the page, so copying a paragraph gives you one line per printed line. This is the most common reason people need a line break remover.

Plain-text email

Plain-text email is often wrapped at around 72 characters per line, and replies add their own wrapping on top. Keep paragraphs restores the original paragraphs from a quoted message.

Microsoft Word

Word can do this with Find and Replace by searching for ^p (paragraph mark) or ^l (manual line break). Pasting here is quicker when you also need the stray spaces cleaned up.

Excel and spreadsheets

Cells with line breaks paste as several lines. In Excel you can also use =SUBSTITUTE(A1,CHAR(10)," ") on a cell, or join the text here when it came from somewhere else.

When to Remove Line Breaks

Quoting a PDF

Paste a passage from a report or paper into a document, chat or citation without the ragged right edge.

Filling a single-line field

Forms, spreadsheet cells and search boxes often keep only the first line of pasted text. Joining it first keeps the whole thing.

Cleaning up captions and bios

Text drafted in a notes app can carry breaks that look wrong once posted. Join the lines, then add back only the breaks you meant.

Preparing text for other tools

Translation tools, word counters and text-to-speech read hard-wrapped text more naturally once each sentence is on one line.

Frequently Asked Questions

Related Text Tools

Browse all text tools →