Sort Lines
Paste your lines and sort them alphabetically, numerically, by length or at random, in either direction. Natural sorting puts item2 before item10, and accented letters sort where the language expects. Random order uses a cryptographic Fisher-Yates shuffle, so every order is equally likely. Your text is never uploaded.
Updated
How to use Sort Lines
- 1Paste your lines.
- 2Choose a sort method and direction.
- 3Turn on natural sorting if your lines contain numbers.
- 4Copy the sorted result.
How it works
Alphabetical sorting uses your browser's locale-aware comparison, which orders accented characters the way the language expects — so 'é' sorts next to 'e' rather than after 'z', which is what a plain byte comparison would do.
Natural sorting is the option most people actually want when their lines contain numbers. A plain alphabetical sort puts item10 before item2, because it compares character by character and '1' comes before '2'. Natural sorting reads runs of digits as numbers, giving item2, item10, item100 — the order a human would use.
The random option uses a Fisher-Yates shuffle driven by cryptographic randomness, which produces a genuinely uniform permutation. Sorting by a random key, the common shortcut, does not.
Your text is processed by JavaScript running in this page and is never sent over the network. That matters when you are pasting a draft, a client brief, meeting notes or anything else you would rather not hand to a server.
Tips and common mistakes
- Turn on natural sorting when lines contain numbers, so item2 comes before item10.
- Use numeric mode for lists of plain numbers.
- Remove duplicates first with Remove Duplicate Lines if the list may contain repeats.
- Use random order to shuffle names for a draw or a seating plan.
Frequently asked questions
Why does item10 come before item2?
How are accented characters handled?
Can I sort numbers properly?
Can I sort in reverse order?
Can I shuffle a list randomly?
Can I sort by line length?
Guides
- How to remove duplicate lines from a list
- How to sort a list properly — and why item10 comes before item2
- How to pick a random winner fairly — and prove it
- How to make barcodes for inventory and stock labels
- How to number invoices: formats that keep accountants happy
- How to name files so they sort in the right order