How to sort and clean a list
- Paste your list, one item per line — email addresses, product codes, names, file names, keywords.
- Choose a sort order and how to treat duplicates. Trimming spaces and removing empty lines are on by default because pasted lists often carry both.
- Press Apply. The result appears on the right with a count of lines kept and removed; changing an option re-applies it immediately.
- Copy the result, or press Use result as input to run another pass.
How the sorting works
Alphabetical order follows your language
Sorting by raw character codes puts every capital letter before every lower-case one and throws accented letters to the end, so "apple" would follow "Zebra" and "Émile" would follow "zoo". This tool compares lines with the browser's Intl.Collator, which applies the Unicode Collation Algorithm and the conventions of the page's language: letters are compared first, then accents, then case. On the Chinese page, Chinese text is ordered by pinyin, the order used in most modern Chinese dictionaries.
Natural order
Plain alphabetical order compares digits as characters, so file10 comes before file2 because 1 is less than 2. Natural order reads runs of digits as numbers, giving file1, file2, file10 — the order a person expects for numbered files, chapters and versions.
Duplicates
Duplicates are removed keeping the first occurrence, so the order of the remaining lines is preserved when you do not sort. "Ignoring case" treats Apple and apple as the same line and keeps whichever came first. Duplicates are checked after trimming, so "apple" and "apple " (with a trailing space) are caught when trimming is on.
Random order
Shuffling uses the Fisher–Yates algorithm with the browser's cryptographic random number generator, so every possible order is equally likely. It is the same method as the random picker tool, which also offers draws and teams.
Examples
| Input lines | Setting | Result |
|---|---|---|
| file10, file2, file1 | A → Z | file1, file10, file2 |
| file10, file2, file1 | Natural | file1, file2, file10 |
| b, a, c | Z → A | c, b, a |
| ccc, a, bb | Shortest first | a, bb, ccc |
| Apple, apple, Banana, apple | Remove, ignoring case | Apple, Banana (2 removed) |
| Apple, apple, Apple | Remove exact duplicates | Apple, apple (1 removed) |
Cleaning a mailing list: paste addresses exported from two sources, choose A → Z and Remove ignoring case, and duplicates that differ only in capitalisation disappear while the list comes out sorted.
Limits
- One item per line. Comma- or tab-separated values on a single line are treated as one item; use the CSV tools for tables.
- Similar is not the same. "St." and "Street", or two spellings of a name, are different lines; only exact matches (optionally ignoring case) are removed.
- Mixed scripts. When a list mixes Latin, Chinese and other scripts, the collation order between scripts follows Unicode defaults, which may not be the order you would choose.
- Numbers with separators. Natural order reads 1,000 as the numbers 1 and 000; remove thousands separators first if you need numeric order of formatted numbers.
Frequently asked questions
How do I remove duplicate lines?
Paste the list and choose Remove exact duplicates, or Remove ignoring case if Apple and apple should count as the same. The first occurrence of each line is kept.
Why does file10 come before file2?
Alphabetical order compares character by character, and 1 comes before 2. Choose Natural order to compare the numbers by value.
Can it sort Chinese by pinyin?
Yes. On the Chinese version of this page, Chinese lines are ordered by pinyin.
Is the random shuffle fair?
Yes. It uses the Fisher–Yates shuffle with a cryptographic random source, so every order is equally likely.
Is my list uploaded?
No. Sorting and de-duplication happen in your browser.