Sort Lines
Paste a list with one item per line and choose how to order it. The sorted list appears as you change the options, ready to copy.
Use the tool
Loading the tool…
About Sort Lines
Sort a list of lines in a chosen order: A to Z, Z to A, numbers smallest or largest first, shortest or longest line first, or reversed. You can ignore capital letters, and choose a natural order so that file2 comes before file10.
Worked example
Paste `banana`, `Apple` and `cherry`. Choose A to Z with capitals ignored. The result is Apple, banana, cherry.
Limits
Sorting does not remove duplicate lines. Check the result if the order matters for your data.
How to use Sort Lines
- Paste or type your lines.
- Choose the sort order and any options below it.
- Read the sorted result and use Copy the result.
Good to know
- Letters are compared by their Unicode code points, so with case ignored off, capital letters come before small ones and accented letters come after plain ones.
- Natural order puts file2 before file10. Without it, file10 comes before file2.
- In number order, lines that are not numbers go to the end in their original order.
- Lines with equal sort keys keep their original order.
Frequently asked questions
Does it remove duplicates?
No. It only reorders lines. Duplicates stay next to each other after sorting.
How are numbers like 1,000 handled?
A line with thousands commas, such as 1,000, is read as the number one thousand in number order.
Is anything I type saved or sent?
No. The work happens in your browser on this page, and nothing is stored or sent to us.