Skip to content

List Converter

Transform lists between formats - comma-separated, newline, bulleted, numbered, JSON array, SQL IN clause, and HTML.

List Converter tool

Loading...

Example

Input: 3 lines: apple, banana, cherry - Output Format: SQL IN clause

Result: ('apple', 'banana', 'cherry')

The tool detects 3 items, wraps each one in single quotes (doubling any quote inside) and joins them inside parentheses, ready for a SQL WHERE ... IN query.

  1. Paste your list into the input area in any supported format (one per line, comma-separated, tab-separated and so on).
  2. Leave Input Format on Auto-detect or pick the separator yourself.
  3. Choose an output: newline, comma, semicolon, tab, bulleted, numbered, JSON array, SQL IN clause or HTML list.
  4. Check the converted list and the number of items detected.
  5. Click the copy button to copy the converted list.

Converting Lists Between Formats

The List Converter changes a list from one format to another. Paste items one per line, or separated by commas, semicolons or tabs. Then get them back as a comma-separated line, a bulleted or numbered list, a JSON array, a SQL IN clause or an HTML list. Comma-separated is the default output.

Auto-detect picks the separator that appears most often in your input. That works for most lists, but it can guess wrong. A list of "City, State" pairs, one per line, has more commas than line breaks, so each city and state would become a separate item. In that case, set the input format to Newline by hand. Auto-detect also reads a JSON array of simple values, so you can turn JSON output back into lines.

Every item is trimmed and empty items are dropped, so stray spaces and blank lines disappear. If every line starts with a bullet (-, * or •) or a number such as "1." or "2)", the markers are removed first. That way a list copied from a document converts cleanly. The count under the menus shows how many items were found.

The SQL option wraps each item in single quotes and doubles any quote inside, so O'Brien becomes 'O''Brien'. The HTML option escapes <, >, & and quotes. JSON output is a formatted array of strings. To drop repeats or sort the list first, use Remove Duplicate Lines or Sort Lines.

Frequently Asked Questions

Select the cells in the column and copy them. Paste them into the input box, where each cell arrives on its own line. Leave the input on Auto-detect or choose Newline separated, and set the output to Comma separated. You get one line such as "apple, banana, cherry", ready to paste anywhere.
Paste the values, one per line, and choose SQL IN clause as the output. The tool wraps each value in single quotes and joins them in parentheses, such as ('apple', 'banana', 'cherry'). Add it after WHERE name IN in your query. Every value is quoted as text, so remove the quotes by hand for number columns if your database needs that.
No. The converter splits at every separator, even one inside quotes, so "Paris, France" in quotes still becomes two items. It is built for simple lists, not full CSV files. For real CSV data with quoted fields, use a dedicated CSV to JSON converter or a spreadsheet instead.
The tool treats every item as text, so 42 comes out as "42" in the JSON array. That keeps values like postal codes with leading zeros safe. If you need real numbers, remove the quotes with a find and replace, or change the type in your code after reading the array.

Related Tools

Sort Lines

Sort lines of text alphabetically (A-Z or Z-A) with natural number order, by line length, or shuffle and reverse them.

Text and Writing

Remove Duplicate Lines

Remove duplicate lines from text while keeping the original order. Supports case-sensitive and case-insensitive modes.

Text and Writing

JSON Formatter and Validator

Format, validate, beautify, and minify JSON data with a collapsible tree view and line-and-column error detection.

Developer Tools

CSV to JSON Converter

Convert CSV data to a JSON array of objects with header mapping and automatic comma, semicolon, or tab detection.

Developer Tools