My Tool Studio
Text

Comma Separator

Paste a column of values and this comma separator turns it into a comma-separated list in one step, or turns a comma list back into a column. It detects whether your items are split by lines, commas, semicolons, tabs, pipes or spaces, and you can pick the separator for the result, from a plain comma to a comma and space, a semicolon or your own text. Each item can be wrapped in double, single or backtick quotes, and the whole list in parentheses or brackets, so presets build a SQL IN list or a JSON array instantly. Trim spaces, drop empty items, remove duplicates, sort, and put a set number of items on each line. Analysts, developers and marketers use it daily, and nothing leaves your browser.

Always freeNo sign upRuns in your browser
Presets:

How to use

01

Paste your list

Paste a column copied from a spreadsheet into Your list, open a .txt or .csv file, or press Try sample to load a short SKU column with a blank line and a repeat.

02

Pick the output format

Click a preset such as SQL IN or JSON, or choose Join items with, Quote each item and Wrap the whole list yourself. Tick Remove duplicates or pick a Sort order if needed.

03

Copy the list

The counter shows how many items were found and which separator was detected. Press Copy, Download .txt, or Use result as input to convert it again.

Why Comma Separator

Preset examples

Each preset applied to the three values red, green and blue.

PresetResult
a, b, cred, green, blue
SQL IN ('a','b')('red','green','blue')
JSON ["a","b"]["red","green","blue"]
CSV row"red","green","blue"
Back to a columnred, green and blue on three lines

Doing it in Excel or Google Sheets

Spreadsheets can join a column too. In Excel 365 and Google Sheets, =TEXTJOIN(", ",TRUE,A2:A100) joins a range with a comma and a space and skips empty cells. To add quotes, use =TEXTJOIN(",",TRUE,"'"&A2:A100&"'"), entered as an array formula in older versions. To split a comma list into cells, use Data, Split text to columns in Sheets or Data, Text to Columns in Excel.

Common questions

How do I convert a column to a comma-separated list?
Copy the column from Excel or Google Sheets and paste it into Your list. Each cell arrives as one line, and the result joins them with a comma and a space. Pick Comma (a,b) in Join items with if you do not want the space.
How do I turn a comma-separated list back into a column?
Paste the list and click the Back to a column preset, or set Join items with to New line. The separator is detected automatically, so a,b,c or a; b; c both become one item per line, ready to paste into a spreadsheet.
How do I make a SQL IN list from a column of values?
Click the SQL IN ('a','b') preset. Each value is wrapped in single quotes, joined with commas and the whole list is put in parentheses, ready to paste after WHERE id IN. Escape quotes inside items stays ticked, so O'Brien becomes 'O''Brien' as SQL expects.
Can the comma separator make a JSON array?
Yes. The JSON preset wraps each item in double quotes, joins them with commas and adds square brackets, giving ["a","b","c"]. Double quotes inside an item are doubled rather than escaped with a backslash, so check items that contain quotes before using the array in code.
How does the tool detect which separator my list uses?
With Split the input on set to Detect automatically, line breaks win first, then tabs, then whichever of commas, semicolons or pipes appears most often, and finally spaces. The counter says which one was used. Pick a separator yourself if the guess is wrong.
Can I remove duplicates while converting a list to CSV?
Yes. Tick Remove duplicates and repeated items are dropped, keeping the first copy. Leave Trim spaces ticked so items that differ only by padding count as the same. The item count updates to show how many are left.
How do I split a long comma list over several lines?
Set Items per line to a number such as 10. The list is broken into rows of that many items, and each row ends with the separator so the rows still read as one list. Leave it at 0 to keep everything on one line.
Is there a limit on how many items I can comma separate?
There is no fixed limit. Tens of thousands of items convert instantly, since the work happens in your browser. Very large results can make the text box slow to scroll, so download them as .txt instead of copying.

More Text tools

View all