# Comma separator

Canonical page: https://datalens.flazetech.in/convert-column-to-comma-separated-list

Publisher: DataLens by Flazetech (https://datalens.flazetech.in/about).

Turn a column of values into a comma separated list. Paste from a spreadsheet or text file, choose your options, and copy the result.

## How to convert a column to a comma separated list

1. Copy a single column from Excel, Google Sheets, a database result, or a text file.
2. Paste it into Column input. New lines are the default input separator; commas are the default output.
3. Optionally remove duplicates, add quotes, or use the JSON array preset. Copy or download your list.

## Worked example

### Example input

```text
London
Mumbai
Tokyo
```

### Example output

```text
London,Mumbai,Tokyo
```

## Common questions

### How do I add commas to a list of names or IDs?

Paste one value per line and select Comma as the output separator. The comma separator joins the values with commas and does not add a trailing comma. Trimming removes surrounding spaces and empty lines when enabled.

### Can I convert an Excel column into a comma separated list?

Yes. Copy the cells in one Excel or Google Sheets column and paste them into Column input. The tool recognizes Windows and Unix line endings. Use the CSV converter if you need to keep multiple columns as a table.

### How can I make a JSON array from a column?

Choose the JSON array preset. Each value becomes a JSON string with escaped quotes and backslashes, and the list is wrapped in square brackets. Numeric-looking values remain strings so identifiers keep leading zeroes.

### Can I quote values for a SQL IN clause?

Choose the SQL list preset to wrap string values in single quotes inside parentheses. Embedded apostrophes are doubled. Review the result for your SQL dialect; use bound parameters when constructing queries in application code.

## Related guides

- [Convert an Excel column to a comma-separated list](https://datalens.flazetech.in/guides/excel-column-to-comma-list)
- [Convert CSV to JSON without losing field values](https://datalens.flazetech.in/guides/csv-to-json-preserve-values)

## Data handling

[Processing and privacy](https://datalens.flazetech.in/privacy). Formatting and conversion run in the browser. Optional sharing and API requests can transmit supplied data. The interactive tools require JavaScript; this reference does not.
