Remove line breaks from text

Join wrapped lines into paragraphs and keep the blank lines you want. Nothing leaves your browser.

How it works

  1. Paste text with line breaks
  2. Choose a space or nothing, and keep paragraphs
  3. Copy the joined text

What counts as a line break and a paragraph

Windows, old Mac and Unix line endings are each read as one line break. A line that is empty, or holds only spaces and tabs, is a blank line. One or more blank lines in a row mark a paragraph break. This tool is for text that was wrapped at a fixed width, for example when copied from a PDF, an email or a terminal, and needs joining again. It is not the tool for turning a comma list into lines or lines into a comma list, and it does not cut text into parts. It only removes line breaks.

Space, nothing and paragraph breaks

With A space selected, the lines inside a paragraph are joined with a single space, so a line break between two words becomes the gap between them. With Nothing selected, they are joined directly, which suits wrapped codes or addresses, but would glue words together in normal text. Keep paragraph breaks is on by default: each run of blank lines becomes exactly one blank line, so two, five or ten empty lines all become one. Turn it off and the whole text becomes one line, with blank lines dropped. Leading and trailing blank lines are always dropped, and the result has no final line break.

Spaces and hyphens

Spaces already at the start or end of a line are kept, so a line ending in a space joined with a space gives two spaces in a row. Collapse double spaces fixes that by turning every run of spaces and tabs in the result into one space. It acts on the whole text, including spaces and tabs inside lines, so leave it off when you need to keep aligned columns or indentation. Words broken with a hyphen at the end of a line, such as inter- and national, are not repaired: the hyphen stays and a space is added. Use find and replace on the result for those.

Counts and limits

The result shows how many line breaks were removed and how many paragraphs remain. A blank line shortened from several to one counts as removed. The work happens in this tab, and the text is not uploaded or stored. Only your choices are remembered in this browser. Text up to 1,000,000 characters is handled.

Frequently asked questions

How do I put all my text on one line?

Turn Keep paragraph breaks off. Every line is then joined into a single line, with blank lines dropped, and with A space selected the words stay separated.

Why are there double spaces after joining?

Some lines end with a space, and a space is added when joining. Turn on Collapse double spaces to merge them. It also merges double spaces that were inside lines.

Can I join lines with a comma instead of a space?

Not here. This tool joins with a space or nothing. To turn a list into a comma-separated line, use the delimiter converter, and for any other joiner use find and replace.

Will it keep my paragraphs when I copy from a PDF?

Yes, if the PDF has a blank line between paragraphs and Keep paragraph breaks is on. Text where paragraphs are only marked by an indent, with no blank line, is joined into one paragraph.

What happens to Windows line endings?

Both the carriage return and the line feed of a Windows break are removed together as one break. Any that remain, between paragraphs, come out as a plain line feed.