Maaz Zindani

Loading the index…

↑↓ move↵ openesc close3993 pages

Free tool · Writing tools

Remove line breaks

Paste text that is broken into short lines, and get it back as flowing text. Choose what replaces each break. Your text stays on your device.

  • Free
  • No sign-up
  • Runs in your browser

By Maaz Zindani · Updated

Replace each line break with
Options
Result
The quick brown fox jumps over the lazy dog. A second paragraph starts here and wraps too.
  • 4 line breaks removed
Line breaks
4 before, 0 after
Characters
91 before, 90 after
Lines
5 before, 1 after

How to use the Remove Line Breaks

  1. Paste your text into Your text.
  2. Under Replace each line break with, choose A space, Nothing or A comma and space.
  3. Tick Keep paragraphs to leave blank lines in place, or Join split words for text copied from a PDF.
  4. Read the result and the before and after counts, then press Copy.

How do I remove line breaks from text copied from a PDF?

PDFs and scanned documents store text as lines that end where the page ends, so a copied paragraph arrives with a break after every line. Paste it here with the default settings: every break becomes a single space, and extra spaces at the line edges are cleaned up. Four lines in, one line out.

PDFs also split long words with a hyphen at the end of a line, such as "recog-" followed by "nition". Tick Join split words and the hyphen is removed and the two halves are glued back together: "recognition". The tool only does this when the next line starts with a lowercase letter, so "Anglo-" followed by "Saxon", or a page range such as "3-" followed by "5", keep their hyphen. The option is off by default because a real hyphenated word like "well-" followed by "known" at the end of a line would otherwise lose its hyphen without you noticing.

How do I keep paragraphs but join lines?

Tick Keep paragraphs. A blank line, or several in a row, is read as a paragraph break and kept as one blank line, while the lines inside each paragraph are joined. The example text on this page has two paragraphs of two lines each: without the option you get one long line, with it you get two lines separated by a blank line.

This is the setting to use for an article, an email or an essay. Leave it off when you want everything on one line, for example to paste a list into a search box or a single-line form field.

How do I replace line breaks with a space or comma?

A space is right for sentences. Nothing glues the lines together with no gap, which suits things like a code or a number that was split over several lines. A comma and space turns a column of items into a list: "red", "green" and "blue" on three lines become red, green, blue. Empty lines are skipped in that mode so you never get two commas in a row.

Computers store a line break in more than one way. Linux and modern macOS use a single character, written \n. Windows uses two, \r\n, and very old Mac files used \r alone. This tool recognizes all three, so text from any system gives the same result. The counts show line breaks and characters before and after, so you can see how many were removed. Collapse extra spaces, on by default, turns runs of spaces and tabs into one space; switch it off if the spacing in your text matters.

Use it with

Questions

How do I remove line breaks from a PDF paste?

Paste the text, keep A space selected, and tick Join split words if words are cut with a hyphen at the end of a line. Copy the result.

Can it keep paragraphs?

Yes. Tick Keep paragraphs and blank lines stay as paragraph breaks while the lines inside each paragraph are joined.

Can I replace line breaks with commas?

Yes. Choose A comma and space. A column of items becomes one comma-separated line, and empty lines are skipped.

What is the difference between \n and \r\n?

\n is the line break used on Linux and macOS. Windows uses two characters, \r\n. This tool handles both, and a lone \r too.

Is my text uploaded anywhere?

No. Everything runs in your browser, so the text stays on your device.

How this page was made: the tool's results are computed in your browser by the code on this page; the explanations were drafted with AI help and checked against the tool's own output.