Skip to content
Toolew.com

Column to Comma Separated List

Convert a column of values into a comma-separated list, quoted for SQL or JSON, with brackets, de-duplication, sorting and chunking.

Runs in your browser. Your data is not uploaded.
Loading tool…

Tool guide

What this tool does

Column to Comma Separated List joins values pasted one per line, typically from a spreadsheet column, into a single delimited list. Add quotes for SQL or JSON, wrap the list in brackets, remove duplicates, sort, split long lists into chunks, or reverse the process.

Copying a column from Excel or Google Sheets gives you one value per line. Many destinations want the opposite: a SQL IN clause, a JSON array, a tag field, an email To line or a URL parameter all need values joined by commas, often with quotes. Rewriting dozens of IDs by hand invites typos and missing commas.

Paste the column and the converter trims each value, skips blanks and joins the rest with the delimiter you choose. Quoting follows the rules of the target: SQL doubles apostrophes (O’Neill becomes O''Neill), JavaScript-style double quotes escape backslashes and quotes, and CSV quoting only wraps values that contain a comma, quote or line break, as RFC 4180 specifies. Sorting uses natural order, so 2 comes before 10. Lists can be split into lines of N values, and the reverse direction understands quoted values. It runs entirely in your browser.

How to use Column to Comma Separated List

  1. Paste your column into “Column (one value per line)”, or click Sample.
  2. Keep Direction on “Column → delimited list”, or choose the reverse to split a list into lines.
  3. Choose a Delimiter, such as “Comma and space” or a custom one like “ OR ”.
  4. Pick how to “Wrap each value”, for example single quotes for SQL, and how to “Surround the list”.
  5. Set trimming, empty values, duplicates and sorting.
  6. Optionally set “Values per line” to split long lists, then copy or download the result.

Tips for better results

  • For a SQL query, choose single quotes and round brackets to get ('a', 'b') ready for WHERE id IN.
  • Choose double quotes and square brackets to produce a valid JSON array of strings.
  • Oracle limits an IN list to 1,000 expressions; set “Values per line” to 1000 and combine the lines with OR.
  • When copying several columns from a spreadsheet, turn on “Use only the first column” to ignore the rest.

Common use cases

  • Building a SQL IN clause from a column of customer or order IDs.
  • Creating a JSON array of product codes for an API request.
  • Joining a list of email addresses with semicolons for the To field of a mail client.
  • Turning a comma-separated list of tags back into one tag per line for a spreadsheet.

Common mistakes to avoid

  • Forgetting to quote text values in SQL, which makes the database treat them as column names.
  • Leaving duplicates in an IN list, which is harmless but makes queries longer and harder to review.
  • Using a plain comma split on values that themselves contain commas; use CSV quoting so they stay intact.

Frequently asked questions

How do I convert an Excel column to a comma-separated list?

Select the cells in the column, copy them, paste them into the input box and keep the default comma delimiter. Each cell becomes one item; empty cells are skipped and spaces are trimmed.

How are apostrophes handled in SQL quoting?

An apostrophe inside a value is doubled, so O'Neill becomes 'O''Neill'. That is the standard SQL way to include a quote inside a string literal and prevents broken queries.

Can it convert a comma-separated list back to a column?

Yes. Set Direction to “Delimited list → column” and choose the delimiter used in your list. Values in double quotes may contain the delimiter and are kept whole.

Is there a size limit?

Lists with hundreds of thousands of values convert in a fraction of a second. Very large outputs can still be downloaded as a text file instead of copied.

Feedback & suggestions

Help us improve Column to Comma Separated List. We read every message.

Rating (optional)
Necessary
Required for security, language and theme preferences. Always on.