Line Sorter
Sort any list of lines alphabetically, by length, or randomly. Supports case-insensitive sorting — useful for organising lists, imports or CSV data.
About This Tool
Sort any multi-line list instantly — alphabetically, by line length, or randomly. Useful for organising word lists, sorting CSS class names, ordering import statements, cleaning up CSV rows, or any situation where you need lines in a specific order without manually rearranging them.
Features
- ✓Five Sort Modes — A→Z, Z→A, shortest first, longest first, and random shuffle.
- ✓Case-insensitive Option — Optionally ignore case so "banana" and "Banana" sort together.
- ✓Preserves Blank Lines — Blank lines are treated as empty strings and sorted accordingly — not silently dropped.
- ✓Live Output — Output updates immediately as you change sort mode or options.
FAQ
- How does random sorting work?
- A Fisher-Yates shuffle is applied to the array of lines, producing a statistically uniform random permutation each time you click the Random button.
- Does case-insensitive sorting affect the output text?
- No. The case of the original text is preserved in the output — the option only affects the comparison used for ordering.
- Can I sort numbers?
- Sorting numbers alphabetically (A→Z) will produce lexicographic order — e.g. 1, 10, 2, 20. For true numeric sorting, consider converting the list to a spreadsheet or script.
Further Reading
- wikipediaSorting algorithm — Wikipedia
- wikipediaFisher-Yates shuffle — Wikipedia