Utilities

Sort & Deduplicate Lines

Sort lines alphabetically, by length, reverse order, remove duplicates, or shuffle randomly.

About the line sorter

Put one item on each line and click a button: A-Z, Z-A, By length, Reverse, Remove duplicates or Shuffle. The box updates in place, so steps can be chained, for example Remove duplicates followed by A-Z. It is a quick way to tidy a list of names, tags, keywords or email addresses before you paste it somewhere else. A-Z and Z-A use your browser's language-aware comparison. Capital and small letters sort together (apple, Banana, cherry), and numbers inside a line are read as numbers, so item 2 comes before item 10. By length puts the shortest lines first, and Reverse flips the current order without sorting. Remove duplicates keeps the first copy of each line. Shuffle uses the Fisher-Yates method, which gives every possible order the same chance. Empty lines are lines too, so after A-Z they gather at the top. Duplicates have to match exactly, capitals and trailing spaces included; if your list came out of a spreadsheet with stray spaces, run it through Clean Up Text first. Sorting happens in your browser and the list isn't sent anywhere.

Frequently asked questions

Is the sort case-sensitive?

No. Uppercase and lowercase versions of a letter sort next to each other, so Banana lands between apple and cherry instead of ahead of every lowercase word. When two lines differ only in capitals, the lowercase one usually comes first.

What if my lines start with numbers?

They sort by value rather than digit by digit, so 2 comes before 10 and 10 before 100. The same goes for numbers later in a line, which keeps chapter 9 ahead of chapter 12.

Does Remove duplicates ignore capitals?

No, it only removes lines that are exactly the same, so Apple and apple both stay. To merge those, convert the list to lowercase with Change Text Case first and then remove duplicates.

How random is Shuffle?

Every order is equally likely, using the browser's standard random number generator. That is plenty for drawing names or mixing quiz questions. Don't use it for anything that needs cryptographic randomness, like picking a winner when money is at stake.