Join lines into one line
Combine the separate lines of a text into one line, with a separator of your choice. The text stays in your browser and nothing is uploaded.
How it works
-
Paste your text
Type or paste the text in the left box, or open a .txt file. No text to hand? Click Example.
-
Instant result
The result appears as you type. Change the options and see straight away what changes.
-
Copy or download
Copy the result with one click, save it as a file or use it as input for a next step.
Example
apple, pear, an empty line, banana and kiwi on separate lines become apple pear banana kiwi with a space as the separator, or apple, pear, banana, kiwi with a comma. The empty line is skipped.
Separators
- Space, comma or semicolon for lists and CSV-style values.
- Nothing, to glue the lines together.
- Custom text, such as
|,-,\tfor a tab or\nfor a new line.
Uses
- Turning a spreadsheet column into a list to paste into an e-mail, a query or a form.
- Putting tags or keywords on one line, separated by commas.
- Combining short lines that were broken by a narrow window.
- Building a parameter list for a command or a URL.
Related
To keep paragraphs and only join the broken lines inside them, use remove line breaks. To go from a line back to a list, use split text. Tidy gaps first with remove empty lines.
Frequently asked questions
How do I turn a column from a spreadsheet into a comma-separated list?
Copy the column, paste it here and choose *Comma*. Each line becomes one item: `apple`, `pear`, `banana` gives `apple, pear, banana`.
Can I use my own separator, such as a tab or a pipe?
Choose *Custom text* and type it, for example ` | `. Type `\t` for a tab and `\n` for a new line; the tool understands both.
What happens to empty lines and spaces around the lines?
By default empty lines are skipped and spaces at the start and end of each line are trimmed, so you do not get stray separators.
How do I do the reverse?
Use [split text](/en/text/split-text) with the delimiter option to turn one line back into a list.