Developer Lists

List to comma separated

What to do

Transformed in your browser · nothing is uploaded

Local · not a CSV writer, no quoting
Advertisement
320 × 100

Turns a column of lines into one delimited line; every value trimmed, empty lines dropped, joined by whatever is in the separator field. The default is a comma and a space. The second option splits a delimited line back into a column.

How to use the list to comma separated

1 Paste a spreadsheet column straight in — each row arrives as a line.
2 Set the separator, or leave it as a comma and a space.
3 Lines to a list joins them; list to lines splits them back.
4 Copy the single line out.

Three lines reading alpha, bravo, charlie come back as alpha, bravo, charlie. Every value is trimmed on the way, which matters more than it looks: a trailing space is invisible in the source and makes a value fail to match anything downstream. Empty rows are dropped too, so a gap in the middle of a pasted column does not turn into an empty value between two commas, which is what a spreadsheet formula would give you.

Splitting back is exact, and that is the part worth knowing. It looks for the separator as a literal string, so with the field set to , : comma and space: the text a,b, c splits into two values rather than three, because only the second comma has a space after it. Set the separator to a bare comma when you are splitting. The other limit is quoting: this is a joiner, not a CSV writer, so a value that itself contains the separator makes the result ambiguous and no amount of splitting will recover it. Either choose a separator the data does not contain. A pipe or a semicolon, or use the JSON to CSV converter, which quotes properly.

Questions

Copy the column and paste it. Each row arrives as its own line already.

MDN, working with strings
Advertisement
300 × 250
Was this tool any good?
Internal signal only · I use it to find the tools worth rebuilding