Skip to main content
Text & Writing Tools

List Converter

Convert lists between one-per-line, comma-separated, JSON arrays, SQL IN lists, HTML and Markdown, with quoting, trimming and sorting.

Paste a list in any common format and choose what to turn it into.

For values that contain commas, use one item per line as the input - splitting on commas would cut them in two.

What Is the List Converter?

It changes how a list is written. Paste items one per line, separated by commas, tabs, semicolons or spaces, and turn them into a comma-separated list, a JSON array, a SQL IN clause, an HTML or Markdown list, or one item per line. It can add quotes, remove duplicates and sort at the same time.

Everyday Uses

  • Turning a spreadsheet column into a comma-separated list for an email or a form.
  • Building a SQL query such as WHERE city IN ('Mumbai', 'Delhi') from a list of values.
  • Making a JSON array for code or an API request.
  • Splitting a comma-separated list into lines so you can sort or clean it.

How to Use It

  1. Paste your list. The separator is detected automatically, or you can choose it.
  2. Choose the output format and whether to wrap each item in quotes.
  3. Tick Remove duplicates or Sort A-Z if needed, then copy the result.

Example

A column of five cities - Mumbai, Delhi, Pune, Delhi, Bengaluru - converted to a SQL IN list with single quotes and duplicates removed gives IN ('Mumbai', 'Delhi', 'Pune', 'Bengaluru'). The same list as a JSON array is ["Mumbai","Delhi","Pune","Bengaluru"].

Quotes Inside Items

When you wrap items in quotes, quotes that are already inside an item are escaped: a single quote is doubled for SQL (O'Brien becomes 'O''Brien'), and JSON output is always escaped correctly. Items that were already wrapped in matching quotes are unwrapped first, so they are not quoted twice.

Limitations

When the input is split by commas, an item that itself contains a comma is cut in two - paste such lists one item per line instead. For real CSV files with several columns, use CSV to JSON. To clean a list before converting it, use Remove Duplicate Lines or Sort Lines.

Frequently Asked Questions

Paste the column, one item per line, and choose Comma-separated or Comma + space as the output. Copy the result into your email, form or code.

Choose "SQL IN ( ... ) list". Text items are wrapped in single quotes and numbers are left as they are, giving output such as IN ('Mumbai', 'Pune').

Yes. Paste the list, leave the input separator on automatic or choose Commas, and choose One per line as the output.

They are escaped: a single quote is doubled for SQL, and other quotes get a backslash. JSON output is always escaped correctly.
Share this tool: