Saved

Press the star next to a tool's name to save it.

All my tools

Remove Line Breaks

This remove line breaks tool joins the lines of pasted text into one block, with a space, nothing or your own separator, and can keep paragraphs.

Windows, Mac and Unix line endings are all handled.

Everything is worked out in your browser. Nothing you type is sent anywhere.

Result

Your joined text will appear here.

Text that has been hard-wrapped, copied from a PDF or pulled out of an email often has a line break at the end of every visual line, even in the middle of a sentence. A remove line breaks tool joins those lines back together so that a paragraph is one continuous block again, ready to paste into a form, a message, a spreadsheet cell or a page layout.

What the remove line breaks tool does

Paste your text, choose what should replace each break and press the button. By default every line break becomes a single space, which restores normal word spacing. You can instead join the lines with nothing at all, which is useful for strings such as long codes or numbers that were wrapped, or with your own text such as a comma, a pipe or a semicolon. A tick box lets you keep paragraphs: blank lines are then treated as paragraph breaks and kept, while the lines inside each paragraph are joined.

How computers mark the end of a line

A line break is not a single universal character. Unix, Linux and macOS end a line with a line feed, Windows uses a carriage return followed by a line feed, and classic Mac OS used a carriage return on its own. [1] Unicode also defines the line separator (U+2028), the paragraph separator (U+2029) and the next line character (U+0085). [1] Support varies between programs: the same article notes that ECMAScript recognises the carriage return, line feed, line separator and paragraph separator as line terminators. [1]

This tool treats every one of those as a line break, so you do not need to know which system produced your text. A Windows pair of carriage return and line feed counts as one break, not two, so you will never get a stray extra space from it.

Choosing what replaces the breaks

ChoiceBest forExample result
A spaceProse, quotations, text copied from PDFsone two three
NothingWrapped codes, URLs or long numbersonetwothree
My own textLists turned into comma or pipe separated valuesone, two, three

When you choose a space, the tool also trims the edges of each line first, so a line that ends with a trailing space does not produce a double space after joining. Empty lines are skipped, which means two paragraphs separated by a blank line are also merged unless you keep paragraphs. When you choose nothing, lines are joined exactly as they are, so no spaces are added or removed.

Keeping paragraphs

If your text has real paragraphs separated by one or more blank lines, tick the keep paragraphs option. The tool then reads the text as a series of paragraphs, joins the lines inside each one and writes the paragraphs back with a single empty line between them. This is the right setting for an article that was hard-wrapped at 70 characters but should still read as separate paragraphs. Without it, the whole text becomes one long line.

Typing your own separator

The own text option accepts any characters. Type a comma and a space to turn a list of items into a comma separated line, a pipe or semicolon to prepare data for another program, or a longer phrase if you need one. You can also type the two characters backslash and n to insert a new line, and backslash and t for a tab. Delimiters are the characters that mark the boundary between separate regions of data, and the Wikipedia article on them notes that CSV uses a comma between fields and a newline between records. [2] If your items themselves contain commas, choose a different separator to avoid confusion later.

Why unwanted line breaks appear

Hard line breaks are inserted by many sources. Email programs wrap lines at a fixed width, PDF files store each visual line separately, and terminals and plain text files often wrap at 72 or 80 characters. When that text is pasted into a wider field, the breaks stay behind and the paragraph looks ragged. Joining the lines fixes the layout, and the receiving program can then wrap the text to its own width, which is why a paragraph pasted into a document or a web form should usually be one unbroken line.

Common uses

  • Joining the lines of a paragraph copied from a PDF or scanned document.
  • Turning a column of values from a spreadsheet into a single line.
  • Putting a list of email addresses on one line separated by commas or semicolons.
  • Removing the hard wraps from an email that was formatted at a fixed width.
  • Preparing text for a field that accepts only one line.

Step by step

  1. Paste your text into the box.
  2. Pick a space, nothing or your own text to replace each break.
  3. Tick keep paragraphs if blank lines should remain.
  4. Press Remove line breaks.
  5. Copy the result and paste it where you need it.

Limits and privacy

The tool handles up to two million characters in one go and works entirely in your browser; nothing is uploaded. Joining lines cannot be undone, so keep your original if the line structure matters, as it does in poems, addresses and code. For code or data in a fixed layout, it is usually better to leave the breaks alone.

What next

Use this often? Add Remove Line to your Home screen.

Frequently asked questions

How do I remove line breaks from text?

Paste the text, leave the option on a space and press the button. Every line break is replaced with a space and the result is shown ready to copy.

Can the remove line breaks tool keep paragraphs?

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

What if I want a comma instead of a line break?

Choose my own text and type a comma and a space. Each break then becomes that text, which turns a list into a comma separated line.

Does it work with Windows and Mac line endings?

Yes. Line feeds, carriage returns, Windows pairs and the Unicode line and paragraph separators are all recognised as breaks.

Is my text sent to a server?

No. Everything is processed in your browser and nothing you paste is uploaded or stored.

What went wrong?

We only receive the reason you pick, never what you typed into the tool.

Thanks for your feedback.

More Text & Writing Tools