Sort Lines of Text
Sorts lines alphabetically or in natural numeric order, so item2 comes before item10.
Loading the tool…
How to use this tool
- Paste the lines you want sorted.
- Choose the direction, and leave natural ordering on if the lines contain numbers.
- Select Sort, then copy or download the result.
What line sorter does
Plain alphabetical sorting puts item10 before item2, because it compares character by character and 1 comes before 2. Natural sorting compares runs of digits by their value instead, which is what anybody looking at a list of versions, hostnames or numbered files actually wants. It is on by default here and can be turned off.
Sorting also uses your browser’s locale rules rather than raw code points, so an accented letter sorts next to its base letter instead of after the entire alphabet. That matters the moment a list contains a name. Case sensitivity is a separate switch, because "apple" and "Apple" being adjacent is usually what you want and occasionally is not.