AnyTool
Your files never leave your device. All processing happens locally in your browser.

Comma Separator

Turn a column of values into a comma-separated list or back: quotes, SQL IN and JSON formats, sorting and duplicate removal

All Text Tools →

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

Paste the column (from Excel, Google Sheets or a text file) into Comma Separator: the comma-separated list appears as you type, ready to copy. Choose quotes, brackets, sorting or duplicate removal, or switch direction to turn a list back into a column.

  • Column → comma list, and back
  • SQL IN ('a', 'b') and JSON ["a", "b"] in one click
  • Sort, remove duplicates, trim spaces
  • Runs in your browser as you type

What is

Comma-separated list

Values written on one line with a comma between them, such as apple, banana, cherry. It is how lists are pasted into SQL queries, code, forms and search filters.

Text Tools

Related terms

CSVDelimiterSQL IN clauseJSON array

How to convert a column to a comma-separated list

Turn a column of values into a comma-separated list in your browser.

10 secWeb browser
  1. 1

    Paste your column

    Copy a column from Excel, Google Sheets or a text file and paste it into the left box.

  2. 2

    Pick a format

    Plain list, SQL IN, JSON array or CSV row, or set the separator and quotes yourself.

  3. 3

    Clean it up

    Sort, remove duplicates, trim spaces or drop empty items if you need to.

  4. 4

    Copy the result

    Click Copy, or download it as a .txt file.

Result: A comma-separated list

Frequently Asked Questions

Copy the column and paste it.

Select the cells in Excel or Google Sheets, copy, and paste into the left box. Each cell becomes one item and the comma list appears on the right; click Copy.

Yes.

Click SQL IN: each item is put in single quotes, quotes inside items are doubled (O'Brien becomes 'O''Brien'), and the list is wrapped in brackets.

Yes.

Turn on Remove duplicates; with Ignore case, Apple and apple count as the same. The number removed is shown.

Yes.

Comma, comma and space, semicolon, pipe, tab, space, new line, or anything you type. You can also put a set number of items on each line.

Yes.

Switch to 'Comma list → column'. The separator is detected, and items in quotes stay whole even when they contain a comma, like "Smith, John".

No.

The list is built in your browser as you type; nothing is uploaded.

Detailed Explanation

How It Works

Ready-made formats

SQL IN gives ('a', 'b') with quotes inside items doubled; JSON gives ["a", "b"] with JSON escaping; CSV row gives "a","b". You can also choose any separator, quotes, brackets, a text before and after each item, and items per line.

  • SQL, JSON, CSV
  • Correct escaping
Methodology

Cleaning the list

Items can be trimmed, empty items dropped, duplicates removed (optionally ignoring case) and the list sorted A→Z, Z→A or naturally (item2 before item10). Counts of items, duplicates and empty lines are shown.

  • Natural sort
  • Counts shown
Technical Details

From list to column

In the other direction the separator (comma, semicolon, tab, pipe or new line) is detected from the text, wrapping brackets are removed, and quoted items stay whole, CSV-style.

  • Separator detected
  • Quoted items kept whole
Privacy & Security

Privacy

Everything runs in the browser as you type; nothing is uploaded.

  • No upload
Formats at a glance (items: O'Brien, Smith)
FormatResult
Plain listO'Brien, Smith
SQL IN('O''Brien', 'Smith')
JSON array["O'Brien", "Smith"]
CSV row"O'Brien","Smith"
One per lineO'Brien⏎Smith

Quotes inside items are doubled for SQL and CSV and escaped with a backslash for JSON and JavaScript.