Join Lines

Joins a list with one item per line into a single line, using the separator you choose, with optional quotes around each item. Use it to turn a column of values into a comma-separated list for code, a spreadsheet formula or a database query.

Up to 1 MiB.

Options

Type \t for a tab or \n for a line break.

How to use the Join Lines

  1. Paste a list with one item per line.
  2. Type the Separator to place between items. Use \t for a tab or \n for a line break.
  3. Optionally wrap each item in quotes, for example to build a list for code or SQL.

Rules applied

  • Spaces around each item are trimmed and empty lines are skipped by default.
  • With Escape quotes inside items, quotes and backslashes inside an item are preceded by a backslash.
  • To split a delimited string back into lines, use Split Text into Lines. To simply remove line breaks inside paragraphs, use Remove Line Breaks.

Limitations

  • Escaping uses backslashes; SQL and CSV use doubled quotes instead.

Worked examples

Comma-separated list

Input

apple
banana

cherry

Result

apple, banana, cherry
Quoted values for code

Input

red
green
blue

Result

"red", "green", "blue"

Practical uses

  • Building an SQL IN list

    An analyst has a column of customer codes copied from a spreadsheet. They set the separator to a comma and wrap each item in quotes. The result is a single line they can paste straight into the IN part of a query.

  • Turning a checklist into one line

    A teacher keeps pupil names one per line but needs them in a single comma-separated line for an email. They type a comma and a space as the separator and join the lines. Blank rows are skipped by default, so no stray commas appear.

  • Making an array for code

    A developer wants a quick array of strings from a plain list of options. They choose a comma as the separator and wrap each item in quotes. The joined line can then be pasted between the brackets without retyping anything.

Privacy: this tool runs entirely in your browser. Your text is not uploaded, logged or saved, and it is never sent to analytics. Maximum input: 1 MiB.