Sort Lines
Sort lines alphabetically, naturally, by number or by length, or shuffle them.
How to use Sort Lines
- Paste your list, one item per line.
- Pick how to sort and the direction.
- Copy or download the sorted list.
How it works
Natural sorting compares numbers inside text by value, so "item 2" comes before "item 10", which is usually what people expect. Alphabetical uses your browser’s language-aware collation, so accented letters sort next to their base letter instead of after Z.
Random shuffle uses the Fisher–Yates algorithm with the browser’s cryptographic random number generator, so every order is equally likely. Use it to randomize a draw, a quiz or a playlist.
Example
Natural sort turns *item 10, Item 2, item 1* into *item 1, Item 2, item 10*. Plain alphabetical sorting would put "item 10" before "Item 2".
Frequently asked questions
What is the difference between natural and alphabetical sorting?
Alphabetical sorting compares characters one by one, so "10" sorts before "2" because "1" comes before "2". Natural sorting reads whole numbers, so 2 comes before 10.
How are upper- and lowercase letters ordered?
With "ignore case" on, "apple" and "Apple" sort together. With it off, uppercase sorts before lowercase when the letters are otherwise equal.
Is the shuffle truly random?
It uses the Web Crypto random generator with an unbiased Fisher–Yates shuffle. It is suitable for fair draws, but for legally regulated lotteries follow your local rules.
Does sorting happen on a server?
No. Your list never leaves this page.
Limitations
- "Leading number" sorting uses the first number found in each line; lines without a number go last.
- Sorting order for some languages follows the browser’s default locale.
Last reviewed November 9, 2026. How we build and test tools.