Remove Line Breaks

Text copied out of a PDF, an email or an export carries a break at the end of every line of the original layout. Paste it here and those breaks come out while paragraph breaks and list items stay, so the text reflows properly instead of collapsing into one block.

Your text0 chars
Joined text
Your result appears herePaste text on the left. It is processed in your browser and never sent anywhere.
01 · Why it happens

The breaks belong to a page you are no longer using.

There are two kinds of line break and they look identical. A soft wrap is the application deciding where a line ends for display, and it changes when the window does. A hard break is a real character in the text, and it never changes at all.

Trouble starts when hard breaks are used to do a soft wrap’s job. Text extracted from a PDF, copied out of a plain-text email, or produced by OCR carries a real break at the end of every visual line of whatever it came from. Those breaks encode a page width, a mail client’s wrap column, or a scanner’s idea of a line, and they travel with the text into every context afterwards.

Which is why the paragraph will not reflow. The container is a different width, and the text is still broken for the old one.

02 · Where it comes from

Six sources of breaks nobody typed.

  • Text copied out of a PDFA PDF has no paragraphs. It has lines positioned on a page, and extracting text gives you exactly that: a break at the end of every visual line of the original layout. Paste it anywhere with a different column width and the result is ragged, because the breaks belong to a page size that no longer exists.
  • Plain-text emailMail clients have wrapped plain text at 72 or 76 characters since long before anyone was reading email on a phone. Quoted replies inherit those breaks and add their own, which is why a forwarded thread arrives looking like a column of fragments.
  • Spreadsheet and CSV exportsA line break inside a quoted field is legal CSV and is read as the end of a record by anything that splits on newlines without parsing quotes properly. One stray break turns a thousand-row import into a thousand-and-one rows, with the last few columns of one record appearing at the start of the next.
  • Code editors with hard wrappingAn editor set to hard-wrap inserts real line breaks at the wrap column rather than displaying a soft wrap. The file then contains breaks that were never meant to be content, and they travel with the text into every system it touches afterwards.
  • Web pages and CMS outputCopying from a rendered page picks up the breaks the layout used, not the ones the author wrote. Pasting that into a CMS produces paragraphs that break mid-sentence, and the editor faithfully preserves them.
  • OCR and scanned documentsOptical character recognition works line by line, so its output is broken at every line it read. Multi-column scans are worse: the breaks interleave two columns of text that were never meant to be read in sequence.
03 · What it breaks

More than a formatting annoyance.

  • Text will not reflowThis is the visible symptom. A paragraph carrying hard breaks cannot rewrap to fit its container, so it stays broken at the old width regardless of the window, the font size, or the device. On a narrow screen every line breaks twice: once where you wanted it and once where the original document did.
  • Data imports split recordsAny system that treats a newline as a record boundary will split a field containing one. The import appears to succeed and the data is quietly wrong, with fields shifted by one column from the point of the first stray break onward.
  • Phrases stop matchingA phrase broken across two lines does not match a search for that phrase, because there is a newline in the middle of it. This affects find-in-page, CMS search and database queries alike, and it is invisible in the rendered output.
  • Published layout goes wrongA CMS converting text to HTML turns single breaks into line breaks and double breaks into paragraphs. Hard-wrapped text therefore publishes as one line per original line, with the spacing of a poem and the content of a paragraph.
04 · The options

Joining lines without destroying the structure.

The whole difficulty is telling a break that was layout from a break that was meaning. These options are how you draw that line.

Replace each break with a space

The default and the right answer for prose. Lines rejoin into continuous paragraphs that reflow properly, with a single space where each break used to be. This is what you want for text extracted from a PDF, an email, or anywhere else the breaks were layout rather than meaning.

Delete breaks entirely

Joins the lines with nothing between them. Correct when the break sits inside something that was split across lines and should never have been: a long URL, a serial number, a base64 string, a hash. Wrong for prose, where it welds the last word of one line to the first of the next.

Replace each break with a comma

Turns a vertical list into a comma-separated one. Useful for converting a column of values into something you can paste into a query, a tag field, or a spreadsheet cell.

Keep paragraph breaks

The option that makes the difference between a usable result and one enormous block. A line followed by a blank line ends a paragraph, and that break stays. Everything inside a paragraph joins up. Turn it off only when you genuinely want the whole text on one line.

Keep list lines

Bullets and numbered items are broken deliberately, so joining them destroys the list. This option leaves the break before any line that opens with a bullet, a dash, or a number followed by a full stop or bracket, so lists survive while the prose around them joins up.

05 · Related problems

Breaks, blank lines and spaces are three different jobs.

Removing line breaks joins lines into continuous text. Removing blank lines closes the vertical gaps between paragraphs and leaves the paragraphs alone. They sound similar and they are opposites, which is why they live in different tools.

Text pulled out of a PDF usually needs both, plus a third pass: extraction leaves trailing spaces at the end of every line, which become double spaces the moment the lines are joined. The ChatGPT space remover and the AI space remover handle trailing spaces, doubled gaps and stacked blank lines.

If the same text is also carrying invisible characters — and PDF extraction is a reliable source of them — the zero-width space remover names and removes those.

Where the text came from an assistant rather than a PDF, all three passes are wanted together, which is what the ChatGPT text cleaner does. The ChatGPT watermark remover is the one to reach for when you need the hidden characters identified rather than just removed.

06 · FAQ

Line break questions.

How do I remove line breaks from text?

Paste it above. By default each break inside a paragraph is replaced with a space, and the breaks that end paragraphs are kept, so the text rejoins into readable paragraphs rather than one continuous block. Every break about to be removed is marked in your own text first.

How do I remove line breaks but keep paragraphs?

That is the default. A line followed by a blank line is treated as the end of a paragraph and its break stays; every other break is removed. This is almost always what you want, and it is the thing most find-and-replace approaches get wrong.

Why does text copied from a PDF break at every line?

Because a PDF does not store paragraphs. It stores lines placed at positions on a page, so extraction returns a break at the end of every visual line of the original layout. Those breaks encode a page width you are no longer using, which is why the text will not reflow.

How do I fix text copied from a PDF?

Paste it here with the default settings. Replace breaks with a space, keep paragraph breaks, and leave tidy spacing on. The result is continuous paragraphs that wrap to whatever container they land in. Check the marked view first if the PDF used bullet lists, since those need the list option on.

Will this join my bullet points into one paragraph?

Not with keep list lines on, which is the default. It leaves the break before any line starting with a bullet, a dash, or a number followed by a full stop or bracket. Turn it off only if you actually want a list flattened into prose.

What is the difference between removing line breaks and removing blank lines?

Removing line breaks joins lines together into continuous text. Removing blank lines closes the vertical gaps between paragraphs while leaving the paragraphs themselves intact. They are opposite jobs, and blank lines are handled by the space remover rather than here.

How do I remove line breaks in Excel?

Use the SUBSTITUTE function against CHAR(10) on Windows or CHAR(13) on Mac, replacing it with a space. Alternatively, Find and Replace accepts Ctrl+J in the find box to stand for a line break. Both work per cell, so a column of them needs the formula filled down.

How do I remove line breaks in Word?

In Find and Replace, ^p matches a paragraph mark and ^l matches a manual line break, and they are not the same thing. Hard-wrapped text usually needs ^p replaced with a space, but doing that indiscriminately joins your paragraphs too. The usual workaround is to replace double ^p with a placeholder first, then single ^p with a space, then the placeholder back.

What is the regex for removing line breaks?

In most editors a newline is matched by \n, or by \r\n for files that came from Windows. Replacing every one of them with a space joins the whole text into a single line, including paragraph breaks, which is why the pattern is rarely what people actually want on its own.

Why did my CSV import create extra rows?

Almost certainly a line break inside a quoted field. It is legal CSV, and anything that splits on newlines without properly parsing quotes reads it as the end of a record. The result is one record becoming two, with every subsequent column shifted.

Does this change the words in my text?

No. Only line breaks are affected, and the optional spacing tidy-up that closes the double spaces joining lines can leave behind. Every word, every punctuation mark and every other character comes through exactly as it went in.

Does it handle Windows and Mac line endings?

Yes. Carriage-return-and-newline pairs from Windows files and bare newlines are both recognised, so text from any source behaves the same way.

Can I turn a list into a comma-separated line?

Yes. Set line breaks to replace with a comma and turn keep list lines off. A column of values becomes a single comma-separated line, which is what you want for pasting into a query, a tag field or a spreadsheet cell.

Is my text uploaded anywhere?

No. Everything runs in your browser. Nothing is transmitted, nothing is stored, and closing the tab discards it.

Is there a size limit?

No. Nothing is uploaded, so there is no request to exceed. Very long documents may take a moment to render the marked view on an older device.