List to comma separated converter

Paste a column from a spreadsheet and get one line like apple, banana, cherry, ready for a SQL IN list, a tag field or a function call. Switch the direction to cut a comma separated string back into a column.

Direction

Items read: 4 · Items written: 4

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Paste your list. By default one item per line is joined into a single line.
  2. Choose the separator and, if needed, quotes around each item, for example double quotes for a CSV row or single quotes for an SQL list.
  3. Turn on duplicate removal if the list repeats itself, then press Copy.
  4. To reverse the job, switch the direction to “One line to lines”.

How it works

When joining, the text is split into lines, each line is trimmed (if that option is on), empty lines are dropped (if that option is on), duplicates are removed (if that option is on), every item is wrapped in the chosen quote and the items are glued with the separator. When splitting, the text is cut at the separator character instead of at line breaks; a quoted item is never cut in the middle.

Worked example

The lines “apple”, “banana”, “cherry”, “banana” with duplicates removed and double quotes give “apple”, “banana”, “cherry”. Four items were read and three were written, as the counts under the result show.

Tips

The result is plain text and does not escape quotes inside items, so check items that contain the quote character itself before using the string in code or SQL. For SQL, remember that numbers do not need quotes, so leave quotes off for a list of numeric IDs.

Frequently asked questions

How do I turn a list into a comma separated string?

Paste the list with one item per line and keep the direction on "Lines to one line". The items appear on the right joined by the separator you chose. Pick "Comma" without a space if the target format does not allow spaces.

How do I go the other way, from commas to lines?

Switch the direction to "One line to lines". The text is cut at the chosen separator, spaces around items are trimmed and each item gets its own line. Line breaks in the input are treated as spaces.

What happens to items that already have quotes or contain a comma?

In the split direction, an item that starts with a quote runs to the matching closing quote, so "Smith, John" stays one item. Its quotes are removed and then replaced by the quote style you pick, if any.

Are duplicates removed case-sensitively?

Yes. "Apple" and "apple" are different items. The first occurrence is kept and the order is not changed.

Is my list uploaded?

No. The conversion runs in your browser, so lists of customers, IDs or addresses stay on your device.

More in Text

All tools in this category: Text ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.