Line Tools: Dedupe, Sort, SQL IN
Cleans up a list line by line (trim, remove empty and duplicate lines, sort, reverse) and outputs it as lines, a SQL IN clause, a comma-separated list or a JSON array.
Loading…
How to use
- Paste a list into the top box, one item per line.
- Tick the clean-up options you need: Trim spaces, Remove empty lines and Remove duplicates. With Ignore case on, duplicate detection treats upper- and lowercase letters as the same, and sorting also ignores accents (é = e).
- Pick A → Z or Z → A under Sort; Natural sort (2 < 10) then appears. Reverse flips the final order.
- Choose the Output format: One per line, SQL IN ( … ), Comma-separated or JSON array. With SQL IN, tick Numbers without quotes to leave numeric values unquoted.
- Check the line counts above the result, then press Copy.
Frequently asked questions
- Is my list sent to a server?
- No. Everything runs in your browser.
- What does natural sort do?
- It compares runs of digits by their value, so item2 comes before item10; without it, item10 comes first because 1 is compared with 2. Letters are ordered by the sorting rules of the page language.
- Which line is kept when there are duplicates?
- The first occurrence stays in place; later copies are removed and counted. With Trim spaces off, “apple” and “apple ” are different lines; with Ignore case on, “Apple” and “apple” are duplicates and the spelling that comes first is kept.
- How does the SQL IN output handle quotes and numbers?
- Each value is wrapped in single quotes and any single quote inside is doubled, so O'Brien becomes 'O''Brien'. With Numbers without quotes, plain integers and decimals such as 42, -7 or 3.14 are written without quotes; everything else stays quoted. Backslashes are left as they are; check them separately if your database treats backslash as an escape character (MySQL's default).
- Are numbers kept as numbers in the JSON array?
- No. Every line becomes a JSON string (for example "42"), and the array is indented with 2 spaces. Comma-separated joins the lines with a comma and a space and adds no quotes.