Sort Lines
★★★★★★★★★★4.8(0 votes)
Sort any list of lines alphabetically, numerically, by length, or randomly. Ascending or descending.
Sort Lines
About This Tool
Sort Modes
- Alphabetical (A–Z, Z–A) — locale-aware string comparison
- Numerical — sorts by the first number found in each line
- By length — shortest to longest or vice versa
- Random shuffle — Fisher–Yates shuffle for true randomness
Why Locale-Aware Matters
Plain string comparison treats 'Z' as less than 'a' (because uppercase has lower ASCII codes). Locale-aware sort handles your language correctly: accented characters sort logically, German ß sorts near s, Turkish dotless ı sorts correctly, and so on.Frequently Asked Questions
How is numerical sort different from alphabetical?
Alphabetically, '10' comes before '2' because '1' < '2' as a character. Numerically, 2 < 10 as you'd expect. Use numerical mode whenever your lines start with a number.
Will this preserve duplicate lines?
Yes — sorting doesn't remove duplicates. If you want unique sorted lines, run this through the 'Remove Duplicate Lines' tool first, then sort.
What's the random shuffle good for?
Random shuffle is great for fair group assignment, randomizing test cases, picking a random winner from a list, or shuffling lyric/poem lines for creative writing.
