Sort Lines Alphabetically

Sort a list of lines alphabetically, numerically, by length, reversed or shuffled, and optionally drop duplicates.

Lines
Sorted
Runs locally in your browser

About the Sort Lines Alphabetically

Alphabetising a list by hand is tedious and error-prone. This tool sorts lines with several orders: A to Z and Z to A (with natural numeric ordering so "item2" comes before "item10"), by length, numerically by the number at the start of each line, reversed, or shuffled into random order. A single pass can also remove duplicate lines.

Case can be ignored or respected. Sorting is locale-aware, so accented letters fall in the expected place. A trailing blank line is preserved so the output ends the way your list did. Nothing is uploaded, so sorting a list of names, emails or keys is private.

To only remove duplicates without sorting, use Remove Duplicate Lines; to reverse the order specifically, the Reverse Text tool with line mode.

How to use

  1. Paste your list, one item per line.
  2. Choose the order and whether to ignore case or remove duplicates.
  3. Copy the sorted list.

Common questions

Does it sort item2 before item10?
Yes, with natural ordering the numbers are compared as numbers, so item2 comes before item10.
Can it remove duplicates while sorting?
Yes, tick "Remove duplicates" to keep only the first occurrence of each line.
How are accented letters ordered?
Using locale-aware comparison, so é sorts near e as expected.