<link rel="stylesheet" type="text/css" href="/mirawhite.css">

Convert a list to comma-separated values

Paste one value per line to join them with commas, or switch direction to split a comma-separated line into a list. Free, nothing to install.

Free, no sign-up, no limit Runs in your browser: your text and files are never sent or saved.

List to comma-separated text

Options
Direction

How to use it

  1. Paste a column from a spreadsheet or a list, one value per line.
  2. Choose the separator and, for SQL "IN (…)" clauses, single quotes.
  3. Copy the result or download it as a .csv file.

Example

Input

red
green
blue
yellow

Output

red, green, blue, yellow

Good to know

  • If a value already contains the separator (for example "1,000"), add quotes or choose another separator, otherwise the result is ambiguous.
  • Quotes inside a value are doubled ("it''s"), as SQL and CSV expect.
  • The .csv download follows the CSV standard: values are quoted only when needed.

Frequently asked questions

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

Select the cells, copy them and paste them here: each cell becomes one value and the result reads “red, green, blue”. In Excel 2019 or Microsoft 365 you can also use =TEXTJOIN(", ",TRUE,A1:A10) to build the same string in a cell.

How do I put quotes around each value for a SQL IN clause?

Choose single quotes under “Quotes around values”: you get 'red', 'green', 'blue', ready to paste inside IN (…). An apostrophe inside a value is doubled (it''s), which is how SQL escapes it. Pick double quotes for JSON-like lists.

How do I turn comma-separated text back into a list?

Switch the direction to “Comma-separated → list”: every value goes on its own line, ready to paste into a spreadsheet column. Values wrapped in quotes, such as "Paris, France", stay in one piece even though they contain a comma.

What if my values already contain commas, like 1,000?

The tool warns you and shows an example, because the result would be ambiguous. Either add quotes around the values or choose another separator: semicolon, tab or vertical bar. The .csv download quotes such values automatically, as the CSV standard requires.

How do I make a comma-separated string in Python or JavaScript?

In Python, ", ".join(items) joins a list of strings; in JavaScript, items.join(", ") does the same, and in C# string.Join(", ", items). This page is handy when the list lives in a spreadsheet or an email rather than in code.

← Back to all tools