List Converter

Transform lists online: change separators, trim, remove duplicates and blanks, sort, reverse, shuffle, add prefixes and suffixes. Ideal for building SQL IN clauses.

Reshape a list: change separators, clean it up, sort it, wrap each item. Paste a column of values and get back a comma-separated string, a quoted SQL IN clause or a JSON-ish array. Every option applies live, in a predictable order: split, clean, case, sort, wrap, join.

Working with lists of values

The order operations run in

Understanding the pipeline makes the results predictable. The input is split on the chosen separator, then whitespace is trimmed, then empty items are dropped, then duplicates are removed, then case is applied, then sorting happens, then prefix and suffix are added, and finally everything is joined. Because deduplication runs before the case change, Apple and apple are treated as different items — convert to lowercase first if you want them merged, by running the list through twice.

Common jobs

  • Spreadsheet column to SQL — paste the column, split on new line, set the prefix and suffix to a single quote, join with a comma. You get 'a','b','c', ready to drop into an IN (...) clause.
  • Comma list to column — split on comma, join with new line, and enable trim to remove the space that usually follows each comma.
  • Deduplicate an export — split on new line, tick remove duplicates, and read the item count to see how many were removed.
  • Build a JSON array — set the prefix and suffix to a double quote and join with a comma, then wrap the result in brackets by hand.

Sorting caveats

Alphabetical sorting uses localeCompare, which respects the accent and case rules of your locale rather than raw code point order. That is usually what you want for human-readable lists, though it means the result can differ slightly between browser locales. Numeric sort parses the leading number of each item, so 10 correctly comes after 9, and items that do not start with a number end up in an unspecified position.

A note on trimming

Trim is enabled by default because invisible trailing whitespace is the single most common cause of failed comparisons when lists come from spreadsheets or copied terminal output.

Open-source notice: implemented with native JavaScript string and array methods. No third-party library is used.

FAQs

How do I turn a spreadsheet column into a SQL IN clause?
Split on new line, join with comma, and set both prefix and suffix to a single quote. The output is ready to paste between the parentheses of an IN clause.
Why are 'Apple' and 'apple' not deduplicated?
Deduplication runs before the case conversion, so it compares the original strings. Convert to lowercase first, copy the result back into the input, then deduplicate.
Why does sorting put accented words in an unexpected place?
Sorting uses localeCompare, which follows your locale's collation rules rather than raw code point order. This is normally the more natural result for human-readable text.
What happens with a custom separator left empty?
An empty split separator would break the text into individual characters, so the tool treats the whole input as a single item instead. An empty join separator concatenates everything.
Does numeric sort handle items that are not numbers?
It parses the leading number of each item. Entries with no leading number cannot be ordered meaningfully and end up in an unspecified position.
Is there a size limit?
No hard limit, but everything runs in your browser tab, so extremely long lists (hundreds of thousands of rows) may feel sluggish while typing.