Skip to content

Free online tool

Remove line breaks

Paste text with unwanted line breaks, such as a paragraph copied from a PDF or an email, and get it back as flowing text. Paragraphs and list items stay apart, and hyphenated words are joined without a stray space. Your text never leaves your browser.

Runs in your browser. Your text is never uploaded.

Runs in your browser. Your text isn’t uploaded or saved.

Options

How to remove line breaks

  1. 1Paste the text with unwanted line breaks into the box.
  2. 2Leave “Keep paragraph breaks” and “Keep list items on their own lines” on to keep paragraphs and lists apart, or turn them off to join everything into one paragraph.
  3. 3For text from a PDF, turn on “Join words split by a hyphen” to rejoin hyphenated words, and “Keep breaks after short lines” if its paragraphs have no blank lines between them.
  4. 4Turn on “Collapse repeated spaces and tabs” if the text has gaps left by columns or indentation.
  5. 5Press Copy result and paste the clean text where you need it. Cleared the text by mistake? Press Undo clear, or Ctrl+Z (⌘Z on a Mac) in the empty box.

Features

  • Joins lines with exactly one space, never two
  • Keeps paragraph breaks and list items, or joins everything into one paragraph
  • Joins words split by a hyphen or a soft hyphen, and lines of Chinese, Japanese, Thai, Lao, Khmer or Myanmar, with no stray space
  • Can keep headings and paragraphs apart in PDF text with no blank lines between them
  • Understands Windows, Mac and Unix line breaks and the Unicode line and paragraph separators, and says how many were removed
  • Free, no sign-up, and your text never leaves your browser

How lines are joined

Here is exactly what the tool does to your text. Everything happens in your browser.

Line breaks
Windows (CR LF), old Mac (CR) and Unix (LF) line breaks are all recognised, and so are the line and paragraph separators (U+2028, U+2029) that InDesign, Word and some PDFs use, vertical tabs, form feeds and NEL. A line break at the very end of the text doesn’t start an extra, empty line. Each line break between two lines of text becomes a single space, unless one of the rules below keeps it or joins the lines with no space.
Spaces where lines meet
Spaces and tabs at the start and end of each line are removed before the lines are joined, so two lines never meet with a doubled space. They meet with no space when a line ends with a soft hyphen (which is dropped), when it ends with a hyphen or dash straight after a letter or digit and the next starts with one (well-known, 10–20), when both sides are Chinese or Japanese characters or full-width digits and letters (1, A), or one of those and an ASCII digit (2024年3月), or one is full-width punctuation such as 。 or ,, and when both sides are Thai, Lao, Khmer or Myanmar characters, the line didn’t end with a space and no blank line comes between them, since in those languages a space ends a phrase. Korean keeps its spaces, and so does a Chinese or Japanese character next to a Latin letter.
Hyphenated words
With Join words split by a hyphen on, a hyphen at the end of a line, straight after a letter, is dropped when the next line starts with a lower-case letter, so “inter-” and “national” become “international”. That also turns “well-” and “known” into “wellknown”, so leave it off for text with many hyphenated words.
Paragraphs
A line that is empty or holds only spaces is a blank line, and a paragraph separator (U+2029) counts as one. With Keep paragraph breaks on, each run of blank lines becomes exactly one blank line between paragraphs. With it off, blank lines are removed. Blank lines at the start and end are always removed.
List items
With Keep list items on their own lines on, a line that starts with a bullet (such as • ◦ ▪ ► ✓) starts a new line. So does a line that starts with - * + – — or · and a space, or with a number of up to three digits, a lower-case letter or a Roman numeral followed by “.” or “)” and a space (1. 2) a. iv.), or in brackets ((a) (12) (IV)), or a capital and “)” (A)), when it starts the text or a paragraph, when the line before it ends with . ! ? : or ; or is a list item itself, or when another line in the paragraph starts the same way (1. and 2., or - and -). Otherwise it’s joined, so a sentence that wraps before “42.” stays whole. A capital letter and a full stop is never a list item, so “J. Smith” stays joined. When a new paragraph starts after a list item, it starts on a new line, even with Keep paragraph breaks off.
Short lines
With Keep breaks after short lines on, a line under three quarters of the length that nine in ten lines are within keeps the line break after it, as the last line of a paragraph usually does. A short line that doesn’t end with punctuation, such as a heading, also keeps the line break before it, unless it’s the last line a list item wraps onto. That’s a line after a line of the item that doesn’t end a sentence, when it’s indented more than the item or, after a line that isn’t short, when it doesn’t start with a capital, starts with the word “I”, follows a word such as “of”, “the”, “and” or “near”, or is a day or a month after “on”, “next”, “last”, “this”, “before”, “after” or “since” (but not after the “on” of “and so on”).
Repeated spaces and tabs
With Collapse repeated spaces and tabs on, each tab, and each run of two or more spaces or tabs, becomes one space. Single spaces, including non-breaking ones, are left as they are.

Private by design

Your text stays with you

Everything runs in your browser. Nothing you type or paste is uploaded, logged or used for analytics, so it’s safe for code, contracts and private notes.

Works with any language

Accented letters, other scripts and emoji come through intact, and Windows, Mac and Unix line breaks are all understood.

Fast with long texts

Results update as you type. Long pastes are handled once you pause, so typing never stutters.

Frequently asked questions

Why does text copied from a PDF have line breaks?

A PDF stores each line of a page separately, so when you copy a paragraph, most programs put a line break at the end of every line. This tool joins those lines back into sentences, and keeps the blank lines that separate paragraphs. If your PDF viewer copies paragraphs with no blank line between them, turn on “Keep breaks after short lines”.

What does “Keep paragraph breaks” do?

With it on, lines next to each other are joined, but the blank line (or lines) between two paragraphs becomes exactly one blank line, so your paragraphs stay apart. With it off, blank lines are removed. Turn off “Keep list items on their own lines” too to join everything into one long paragraph.

Will words get stuck together or get double spaces?

Lines meet with exactly one space, never two, because spaces at the start and end of each line are removed first. They meet with no space where a word was split by a hyphen or a soft hyphen, between Chinese or Japanese characters (also next to a digit, as in 2024年3月), and between Thai, Lao, Khmer or Myanmar characters, since those languages don’t use spaces between words. In Thai, Lao, Khmer and Myanmar a space ends a phrase, so one that ended the line is kept, and paragraphs joined together get one between them. The hyphen is kept, as in “well-known” or “inter-national”; turn on “Join words split by a hyphen” to drop it and get “international”.

How are lists and headings kept?

With “Keep list items on their own lines” on, a line that starts with a bullet such as • or ✓ starts a new line. So does one that starts with a dash (-, –, —) or a number or letter such as “1.”, “2)”, “a)” or “(iv)”, when it starts a paragraph, follows a sentence, a colon or another list item, or is one of several lines in the paragraph that start the same way. A sentence that wraps onto a line starting with “42.” or “— ” stays joined. Only the lines a list item wraps onto are joined to it, and a new paragraph after a list starts on a new line even with “Keep paragraph breaks” off. For headings, turn on “Keep breaks after short lines”: a line much shorter than most keeps its line break, and so does the line before it if it doesn’t end with punctuation, as a heading usually doesn’t. The short last line a list item wraps onto is still joined to the item, unless it starts with a capital, as a heading after the list does. A capital after a word such as “of”, “the” or “near”, a day or a month after a word such as “on” or “next”, or the word “I”, still continues the item, while after “… switched on” a line such as “Next steps” is a heading. After a line of an item that ends a sentence, the next line, indented or not, is read like any other: it starts a new line when that line of the item is short, as an item’s last line often is, or when it’s a heading.

Does it work with Windows and Mac line breaks?

Yes. Windows ends a line with two characters (CR LF), old Macs used CR, and everything else uses LF. All three are recognised, and so are the Unicode line and paragraph separators that InDesign, Word and some PDFs use. The result uses LF, which every modern program understands.

Is my text uploaded or stored?

No. Everything happens in JavaScript in your browser, and your text is never sent to a server, logged or tracked. You can check by opening your browser’s network tab while you type. This tool doesn’t save your text either: it’s gone when you close or reload the page.

Is it free?

Yes. There’s no sign-up, paid plan or adverts, and no limit on how often you use it. Everything runs on your own device, so there are no servers to pay for.

More free text tools

Looking for something else? Browse all free tools.