Convert lines to a comma-separated list
Paste a list of values (one per line) to instantly get a single comma-separated line, ready to paste into a spreadsheet, a SQL query or a code array. Options let you add quotes and adjust the spacing.
How it works
The tool splits your text at each line break, removes extra spaces at the start and end of each line, then joins everything on a single comma-separated line according to the options you chose. It is the reverse of a "split a list into lines" operation.
What is the "quotes" option for?
It is useful for directly generating a SQL IN ('a', 'b', 'c') clause or a JavaScript/Python array, where each item must be a quoted string. Quotes already present in a line are automatically escaped so they don't break the result.
What happens to empty lines in the source text?
By default, empty lines (including those made up only of spaces) are ignored to avoid extra commas such as "a, , b"; uncheck the corresponding option if you would rather keep them as empty items in the final list.
100% local processing: your list is transformed directly in your browser, with no data sent anywhere.