About List Converter
Copy a column from a spreadsheet to build a SQL IN clause, or split a comma-separated string into one item per line — shuffling lists between delimiters is fiddly busywork. This tool transforms lists locally in your browser: convert between newline, comma, and space delimiters, and bulk-add prefixes, suffixes, quotes, plus dedupe, sort, and drop empty lines. For example, three lines a, b, c convert to an SQL IN clause or a JavaScript array literal without hand-adding quotes. The delimiter decides correctness and is the step most often assumed rather than checked. Real data may be separated by commas, semicolons, tabs or pipes, and the wrong choice produces two opposite illusions: content meant as one column splits into several, or content meant to split stays as one. Look at the actual delimiter before converting. Deduplication combined with blank-line filtering changes the item count significantly, so those switches must be confirmed explicitly. Deduplication compares text and knows nothing of business meaning — with a distinct timestamp on every line nothing repeats — while blank-line filtering may also catch whitespace-only lines depending on the implementation. Its boundary with tables and scripts: list conversion suits one-off tidying of tens to thousands of entries with immediate visual feedback, while large volumes or grouping by a business key favour a table or script that can express complex judgement and leave a repeatable record. Order is another consideration. Most conversions preserve it, but deduplication and sorting alter it; where downstream depends on sequence, such as a priority list, confirm the order still matches expectations rather than only checking the contents. Order errors are harder to notice because each item remains accurate. Finally, keep a copy of the original alongside the result. Text operations are irreversible, and a wrong delimiter or switch can only be fixed by converting from the source again; if the source was overwritten the loss is permanent. Back up, convert, then check counts, which costs almost nothing and pays clearly. Quoting and escaping are equally coupled here. When the delimiter appears inside an item, wrap that item in quotes; when the item itself contains quotes, double them; and quote again when it contains a newline. Miss one rule and delimiter-based parsing downstream misaligns, showing up as an extra field or a record split across two lines, which is far costlier to trace than fixing a rule. With many items, browsing becomes the bottleneck. A list of several hundred laid out in one block is hard to navigate, so columns, grouping by initial letter or a search box beat merely adjusting the font size. Treating browsability as a delivery dimension of the output avoids a result that is correct yet nobody wants to read.
How It Works Internally
The core of conversion is the delimiter combined with the dedupe and filter options. A wrong delimiter produces two opposite illusions: splitting semicolon-separated data on commas splits entries containing commas and increases the count, while the resulting fragments may be filtered as blank lines and decrease it. Comparing counts before and after is the cheapest check.
a;b;c split on commasYields one item "a;b;c"; splitting on semicolons yields three — confirm the actual delimiter firstMeasured on This Page
| Sort+dedupe+trim | With surrounding spaces and duplicates, the output matches the Python equivalent |
|---|---|
| Lowercase then dedupe | Apple / apple / APPLE collapse to one entry |
| Reverse+number | Reversal happens first and numbering always starts at 1, not counting backwards |
| Delimiter switch | On comma: input b, a, c yields b,a,c — the same delimiter splits and joins, and inner spacing is dropped |
| Stats | Shows input lines, output lines and how many were removed |
Sorting uses localeCompare, so it is neither codepoint order nor natural order: it follows language convention, which puts Banana near apple rather than after all lowercase letters, yet item10 still sorts before item2. True natural order needs a collator with numeric enabled. Also note dedupe runs after lowercasing and sorting, so turn on lowercase first if you want Apple and apple merged.
How to Use
- Open "List Converter"
- Paste one item per line
- Pick a separator; enable dedupe or sort as needed
- Check the output count and removed duplicates
- Click "Copy" to take the cleaned list
Use Cases
- Build IN clause — Quote each ID and join with commas to paste straight into a SQL IN query.
- Clean pastes — Dedupe and drop blank lines from multi-row data copied out of a spreadsheet.
- Make arrays — Add quotes and commas per line to assemble a string array literal in code.
- Comma to lines — Split a comma-separated tag line into one per line to review each item.
- Add a prefix — Bulk-prepend a path prefix or append an extension to a batch of filenames.
- CSV to array — Convert a comma-separated list from a spreadsheet into a JS/JSON array format for code.
- Deduplication filter — Remove duplicate entries from a newline-separated list before importing into a database.
FAQ
Which delimiters are supported?
Newline, comma, semicolon, space, and tab all work as input or output delimiters, and you can set a custom separator for special formats.
Is dedupe case-sensitive?
By default it removes exact string duplicates, i.e. case-sensitive. Enable the relevant option to ignore case or trim surrounding whitespace.
Are empty lines kept?
Optional. With drop-empty enabled, whitespace-only lines are removed; otherwise they are preserved so you stay in control of the result.
Is sorting alphabetical or numeric?
Default is lexicographic, so 10 sorts before 2. For numeric order, make sure the data is purely numbers and pick numeric sort mode.
Does adding quotes handle existing quotes?
Bulk-quoting wraps each item in quotes. If an item already contains quotes, extra escaping may be needed — verify the resulting SQL or code afterward.
The converted list has fewer entries. Did data get lost?
First check whether deduplication or blank-line filtering is enabled, since both reduce the count and both are expected. If neither is on, verify the delimiter matches the source: splitting semicolon-separated data on commas splits entries that contain commas and increases the count, while a wrong delimiter can also leave fragments treated as blank lines and filtered, which fakes a decrease.
How do I avoid checking a very long list by hand?
Compare entry counts before and after, which is the cheapest sanity check: a pure conversion should preserve the count, and enabling deduplication or filtering should explain any difference. For critical data, sort and compare the first and last several entries to confirm nothing shifted. Scanning a long list by eye misses a line, and a missing line often surfaces only in downstream statistics.
How are existing quotes handled when wrapping list items?
Inner quotes are escaped (saying "hi" → "saying \"hi\"") so the output stays valid JS/JSON. For JSON targets use the JSON mode and let the parser handle escaping — far more reliable than hand-assembling quotes.