Format Code Now
/
TextRemove Line Breaks Next: Reverse Text ›

Remove Line Breaks

TX-12

Paste text that was wrapped over several lines and get it back as one line. You choose what goes between the old lines: a space, a comma, or nothing.

Runs in your browser. Nothing is uploaded.

Text

Joined text

How to use it

  1. Paste your text into the input box, or open a text file and drop it on the box.
  2. Pick what to join lines with: a space, nothing, a comma, or a comma and a space.
  3. Tick Keep paragraph breaks (blank lines) if each paragraph should become one line and stay separate.
  4. Leave Trim each line before joining ticked to avoid double spaces.
  5. Copy the joined text or download it as a .txt file.

Choosing the separator

A space is right for text that was wrapped at a fixed width, such as an email or a PDF copy. A comma, or a comma and a space, turns a column of values into a list you can paste into a formula or a query. Joining with nothing glues the lines together, which suits wrapped identifiers or tokens. The tool does not repair hyphenated words that were split at the end of a line, so a word like inter-national stays as typed.

Empty lines and paragraphs

In the default mode empty lines are dropped, so joining with a comma never gives two commas in a row, and all the text ends up on one line. With Keep paragraph breaks on, each block of text between empty lines is joined into its own line and one empty line is kept between blocks. Several empty lines in a row become one. Lines that only hold spaces count as empty here.

Trimming and the end of the text

With Trim on, spaces at the start and end of each line are removed before joining, so a line that ended in a space does not produce a double space. Turn Trim off if those spaces matter. The result never has a final line break. For quote-wrapped output, a CSV, or a SQL list, use the dedicated tools for those, because this one adds no quotes or escaping.

Questions people ask

How do I remove line breaks from text?

Paste the text and press Remove line breaks. By default the lines are joined with a single space and empty lines are dropped, so you get one line of text. Pick another separator in Join lines with if you need a comma or no gap at all.

How do I turn a column into a comma-separated list?

Paste one value per line and choose A comma or A comma and a space as the separator. The lines are joined into one line like a, b, c. No quotes are added, so for SQL values use the SQL IN List Builder instead.

How do I join lines but keep the paragraphs?

Tick Keep paragraph breaks (blank lines). Each group of lines between blank lines is joined into one line, and a single blank line is kept between groups. It is handy for wrapped text copied from a PDF or email.

Why is there a space missing or doubled between words?

Joining with Nothing glues lines directly, so use A space for normal prose. Double spaces appear if lines end in spaces and Trim is off, so keep Trim each line before joining ticked. Hyphenated words split across lines are not rejoined.

Does it remove empty lines as well?

Yes in the default mode, because an empty line would otherwise give a doubled separator. With Keep paragraph breaks on, empty lines are used as paragraph boundaries and one is kept between paragraphs.

About this tool

Joins the lines with the separator you pick. Empty lines are dropped, so joining with a comma never produces two commas in a row. With Keep paragraph breaks on, each block of text between empty lines is joined into one line and a single empty line is kept between blocks; any extra empty lines between blocks become one. Trimming removes spaces at the start and end of each line before joining, which avoids double spaces when you join with a space. Turn it off if the spaces matter. Joining with nothing glues the last word of one line to the first word of the next. Hyphens at the end of a line are not repaired. The result has no final line break.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.