Sort Lines Alphabetically
Paste a list with one item per line and sort it A to Z, Z to A, naturally, by number or by length, or shuffle it. Duplicates, extra spaces and empty lines can be removed in the same step.
How to use the Sort Lines Alphabetically
- Paste your list into the left box, one item per line.
- Pick a sort mode: alphabetical, natural, numeric, length, reverse or shuffle.
- Tick the clean-up options you need: ignore case, remove duplicates, trim spaces, remove empty lines.
- Press Sort lines. The result also updates as you type.
- Copy the sorted list or download it as a text file.
Sort modes compared
The same four lines sorted with each mode show how different the results can be:
| Input | A → Z | Natural | Numeric | Length |
|---|---|---|---|---|
| file 10 | file 1 | file 1 | file 1 | file 1 |
| file 2 | file 10 | file 2 | file 2 | file 2 |
| file 1 | file 100 | file 10 | file 10 | file 10 |
| file 100 | file 2 | file 100 | file 100 | file 100 |
Alphabetical order compares one character at a time, so “10” and “100” land before “2”. Natural sort and numeric sort read the digits as numbers. Numeric sort looks only at the first number in the line, which makes it ideal for lists such as “42 apples” or prices.
How alphabetical order is decided
- Language-aware: letters with accents sort next to their base letter, so “Éclair” comes right after “date”, not after “z”.
- Case: with Ignore case on, “apple” and “Apple” are equal and keep their original order. With it off, the uppercase form comes first.
- Spaces and punctuation: leading spaces would push a line to the top, which is why Trim spaces is on by default.
- Ties in length or numeric sort are broken alphabetically, so the result is always predictable.
Tips for cleaning up lists
- Combine Remove duplicates with Ignore case to merge entries such as “Paris” and “paris”. The first occurrence is kept.
- Use Reverse current order to flip a list without sorting it, for example to turn a chronological log newest-first.
- Use Random shuffle to pick a fair order for presentations, raffles or team line-ups.
- Press Use as input to chain operations, such as removing duplicates first and then sorting by length.
Frequently asked questions
How do I alphabetize a list?
Paste the list with one item per line, choose Alphabetical A → Z and press Sort lines. The sorted list appears on the right and can be copied or downloaded.
What is natural sort?
Natural sort reads numbers inside text as whole numbers, so "item 2" comes before "item 10". A plain alphabetical sort compares character by character and would put "item 10" first because 1 comes before 2.
How does numeric sort work?
Numeric sort uses the first number found in each line, including decimals, negatives and numbers with thousands commas. Lines without any number are kept in their original order at the end.
Does ignore case change my text?
No. Ignore case only affects comparison, so Apple and apple are treated as equal when sorting and removing duplicates. The lines keep their original capitalisation. With ignore case off, an uppercase line sorts just before the same word in lowercase and both are kept as different lines.
Is the shuffle really random?
Yes. Shuffle uses the Fisher-Yates algorithm with your browser's cryptographic random number generator, so every order is equally likely. Press Sort lines again for a new order.
Is my list uploaded?
No. Sorting happens entirely in your browser and nothing is sent to a server.