piapia123
en

Merge Lines into One

Text

Everything runs locally in your browser — nothing is uploaded

Input
Drop a file here to load its contents
Output

Joining lines comes down to one real decision: what the line break is replaced with. That choice decides whether the result is right — with a space, `hello` and `world` give `hello world`; with nothing, English words fuse into a word that does not exist (`helloworld`), while for Chinese that is exactly what you want. So the default is a space (safe for English) and “nothing” is its own option. Blank lines have to be handled first. When joining line by line, an empty line contributes an empty word and still gets a separator on both sides, which leaves two separators in a row in the result. So dropping blank lines is on by default, and it has to happen before the join. This is also the complete form of “delete all line breaks”: pick Nothing and you get exactly that.

Features

  • Turn line breaks into a space, a comma, a semicolon, nothing at all, or any text you type
  • Blank lines are dropped by default, so no two separators ever end up side by side
  • Each line is trimmed by default (turn it off to keep indentation)
  • Handles CRLF, CR and LF
  • The output is a single line with no line breaks left in it
  • Everything runs locally in your browser; nothing is uploaded

How to use

  1. Paste the lines you want to merge
  2. Choose what the line breaks should become
  3. Click Copy to take the single line

FAQ

Is “delete all line breaks” the same as merging lines?
It is the same operation with a different answer to the one real question. Choose Nothing to delete the line breaks outright, or A space to join the words with spaces. The current selection is shown in the output, so you can see immediately which one produced the result.
Why are there two spaces in a row in my result?
Because the input had a blank line and Drop blank lines is off. When joining line by line, an empty line is still a word and still gets separators on both sides. Turn that checkbox back on — it is on by default, so it was probably switched off deliberately or by accident.
Can I keep the original indentation?
Yes, turn off Trim each line first. Bear in mind the indentation then lands in the middle of the result: joining `a` and ` b` yields `a b` (the separator plus three spaces). Once everything is one line, indentation no longer means alignment, which is why trimming is the default.

Related tools