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.
More Text & Writing Tools
View all 28For 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
- Paste your list. The separator is detected automatically, or you can choose it.
- Choose the output format and whether to wrap each item in quotes.
- 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
Explore More Tools
Keep going with related categories and our most used tools.