araç köşesi

Column to Comma-Separated List Converter

Turn values on separate lines into one delimited line, and back

Your data stays with you. Conversion happens inside the browser; nothing is sent to a server.

How it works

Select the column in your spreadsheet, copy it and paste it into the left panel; the result appears in the right panel as you type. Paste 120 customer IDs, pick the comma delimiter and single quotes, and the output reads 'ANK001','ANK002',… on one line — ready to drop straight into the parentheses of a WHERE id IN (...) query. Leading and trailing spaces are trimmed, empty lines are dropped, and the result line tells you how many items were joined. The direction is detected for you: several pasted lines are joined into one, while a single comma-separated line is split back into stacked values, with any surrounding quotes stripped off. Copy the output with one click or download it as a plain text file.

This tool is also known as convert column to comma separated list, comma separated list maker, excel column to comma separated values, list to one line with commas, sql in list generator, comma delimited list.

What is Comma-separated list?

A comma-separated list packs several values into one line with a delimiter between them: apple,pear,cherry. It is one of computing's oldest data formats — CSV files, email recipient fields, tag inputs and program arguments all use it. The troublesome case is a value that contains the delimiter itself: 'Portland, OR' splits into two values at the comma. The fix is either wrapping values in quotes or choosing a delimiter that never appears in the data, such as a semicolon or a pipe.

What is SQL IN list?

IN is the SQL operator that tests whether a field equals any of several values: WHERE city IN ('Boston','Denver') is shorthand for two equality conditions joined with OR. Inside the parentheses sits a comma-separated list, and text values must be wrapped in single quotes while numbers stay bare. The two most common mistakes when writing one by hand are leaving a trailing comma after the last value and forgetting to escape an apostrophe inside a value — this tool gets both right on its own.

What is the difference between the comma and semicolon delimiters?

Both separate values; the difference is what the destination expects. Programs in an English locale and SQL lists expect commas. In locales that write decimals with a comma — German, French, Turkish among them — 12,5 is one number, and splitting at commas would tear it into 12 and 5. Excel in those locales therefore separates CSV fields with semicolons and expects semicolons between formula arguments. The practical rule: choose the semicolon when the data goes to a comma-decimal spreadsheet or contains decimal numbers, and the comma for SQL queries and English-locale systems.

A quote inside a quote: the small detail that breaks the query

When a value itself contains a quote character, the list cannot simply be glued together: write O'Brien as 'O'Brien' and SQL treats the apostrophe in the name as the end of the value — the query fails, or worse, runs quietly against the wrong data. The rule is simple but always forgotten when done by hand: a quote inside a value is escaped by writing it twice. This tool applies the rule for you: with single quotes selected, O'Brien comes out as 'O''Brien'; with double quotes, a 5" display value comes out as "5"" display".

The same rule runs in reverse: split a list containing 'O''Brien' back into lines and the doubled quote collapses to one, so the line reads O'Brien again. Build a list with this tool and split it with this tool, and values survive the round trip untouched.

Which setting for which job?

Delimiter and quoting are independent of each other; match them to where the data is going.

  • SQL IN (...) query → comma + single quotes; for numeric IDs choose no quoting
  • Email addresses for a recipient field → comma + space, no quotes
  • Tag or keyword list → comma, no quotes
  • Data going back into Excel set to a comma-decimal locale → semicolon
  • Arguments for a script or program → pipe: values containing commas stay whole

Frequently asked questions

How do I turn a spreadsheet column into one comma-separated line?

Select the column and copy it; the clipboard carries the cells as stacked lines. Paste them into the left panel and the tool joins them into a single line with your chosen delimiter. If you copied the header cell too, just delete that value from the start of the output.

How should the quotes look for a SQL IN list?

For text values pick single quotes: the output reads 'ANK001','ANK002' and any apostrophe inside a value is doubled automatically. Numeric IDs (123, 456) need no quotes at all — the None option is correct there.

How do I split a comma-separated list back into lines?

Just paste the delimited single line: automatic direction sees one line, splits it at the delimiter and stacks the values, stripping any surrounding quotes. If your input has several lines and you still want to split them, set the direction to List to lines and every line is split separately.

Is the pasted list sent anywhere?

No. The conversion runs entirely inside your browser; customer IDs, email addresses or whatever you paste never leave this page and are not sent to a server or any third party.