About this tool
The order of the steps
Whatever you tick, the steps always run in the same order: trim the spaces at both ends of each line, remove empty lines, remove duplicates, sort what is left, and finally add line numbers. Because trimming comes first, “ apple” and “apple ” become the same line and only one of them is kept.
Below the result you see the line counts before and after, for example “120 lines → 87 lines · 33 duplicates removed”, so you can check at a glance how much was cleaned up. A single newline after the last line is not counted as an extra empty line.
Alphabetical and natural number order
A → Z uses the collation rules built into your browser (Intl.Collator) for the language of this page, so words are ordered the way a dictionary would order them: accented letters sort next to their base letters instead of after “z”, and upper- and lower-case versions of a word end up together.
With “Numbers by value” on, a run of digits is read as one number. “file2” then comes before “file10”, and “Chapter 1, Chapter 2 … Chapter 10” stays in the order people expect. With it off, the text is compared character by character and “file10” sorts before “file2”, which is how many simple tools behave.
Removing duplicates keeps the first occurrence
- When a line appears more than once, the first occurrence stays and every later copy is removed. Choose “Keep order” to remove duplicates without changing the order of the rest of the list.
- “Ignore case” treats “Apple” and “apple” as the same line and keeps whichever came first. It also makes A → Z ignore case differences.
- Lines that look identical but are encoded differently (for example a letter with an accent typed as one character or as a letter plus a combining mark) are recognised as duplicates too.
By length, reverse, shuffle and numbering
- By length puts the shortest lines first. Lines of equal length keep their original order. Emoji and accented letters count as one character each.
- Reverse lines simply flips the order, so the last line comes first — handy for logs or lists where the newest entry is at the bottom.
- Shuffle mixes the lines with the Fisher–Yates method and your browser’s cryptographic random numbers (crypto.getRandomValues), so every possible order is equally likely. Use it for presentation orders, seating plans or a fair draw. The list is shuffled again whenever you edit it or change an option.
- Number the lines adds “1. ”, “2. ” and so on in front of each line of the result.
Your list stays in your browser
Sorting and de-duplication are computed inside this browser. Customer names, email addresses or any other personal data you paste are never sent to a server and never stored. Closing the page discards everything.
Copying one column from Excel or Google Sheets gives one line per cell. Paste the cleaned-up result back into the sheet and each line goes into its own cell again.