Column to quoted comma list

Paste order numbers or product codes from a sheet and get them quoted and comma separated without typing each one.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter text, quote mark, separator and wrap in parentheses ( ).
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

Each non-empty line is trimmed, any occurrence of the chosen quote is doubled (' becomes '' as in SQL), the value is wrapped in that quote, and values are joined, optionally inside parentheses.

Example

Inputs: Quote mark = Single ('), Separator = Comma and space (, ), Wrap in parentheses ( ) = no. Result: Result: 'SA-1001', 'SA-1002', 'SA-1003', 'SA-1004'; Values: 4.

SA-1001
SA-1002
SA-1003
SA-1004
'SA-1001', 'SA-1002', 'SA-1003', 'SA-1004'

Limits and caveats

  • Doubling the quote suits SQL and CSV; JavaScript and JSON escape with a backslash instead, so check values that contain quotes.

Questions about this tool

How do I use it with SQL?

Turn on parentheses, pick single quotes, and paste the result after WHERE id IN.

What happens to a value that contains a quote?

The quote is doubled, so O'Neil becomes 'O''Neil', the standard SQL way.

Are blank lines removed?

Yes. Blank lines are skipped and each value is trimmed.