Sort Text Lines
Browser processing — files never leave your device
Put any list in order: alphabetical (A–Z or Z–A), natural numeric order, or by line length — with one click.
Loading tool…
How to use this tool
- Paste your lines into the input box.
- Pick a sort: A–Z, Z–A, natural/numeric, or by length.
- Toggle case-insensitive if capitalization shouldn't matter.
- Click Sort lines and copy the result.
About this tool
Plain alphabetical sorting puts "item10" before "item2" because it compares character by character. The natural sort option here compares embedded numbers by value, producing the order humans expect. You can also sort case-insensitively, reverse any order, or sort by line length, which is useful for reviewing data exports and organizing word lists.
Frequently asked questions
- Why does normal sorting put item10 before item2?
- Character-by-character comparison sees "1" before "2" and stops there. Choose the natural sort option to compare the numbers by value: item2, then item10.
- How are empty lines handled?
- Empty lines sort to the top in ascending order. If you don't want them, remove blank lines first with the Remove Extra Spaces tool.
- Does sorting handle accented characters sensibly?
- Yes — locale-aware comparison places accented letters next to their base letters (é near e) instead of at the end of the alphabet.
Related tools
Remove DuplicatesClean duplicate entries out of any list — emails, URLs, keywords, log lines. The first occurrence of each line is kept and the rest are removed.Remove Extra SpacesClean up messy whitespace: collapse repeated spaces, trim the ends of lines, and remove empty lines — each cleanup individually selectable.Text StatisticsGo beyond a simple count: see average word and sentence length, your most frequent words, and estimated reading and speaking times.