How it works
The Text Sorter sorts lines of text alphabetically, numerically, by length, or randomly (shuffle). It supports ascending and descending order, case-insensitive sorting, and natural sort order for strings containing numbers.
Sorting text is a surprisingly frequent need: alphabetizing lists of names, countries, or keywords; sorting version numbers correctly (1.10 should come after 1.9, not before it); ordering error messages in log files; and organizing configuration keys for easier reading.
How to use it: paste your list (one item per line). Select the sort mode: Alphabetical (A→Z or Z→A), Numerical (smallest to largest or largest to smallest), By Length (shortest to longest or longest to shortest), or Random (shuffle). Toggle "Case Insensitive" and "Remove Duplicates" for additional processing.
Natural sort: standard alphabetical sorting places "item10" before "item2" because "1" < "2" in ASCII. Natural sort correctly orders numeric segments as numbers — "item2" before "item10" — which is the behavior you'd expect from a file manager. Enable natural sort for version numbers, file names, and numbered lists.
CSV column sort: paste a single column of CSV data (with no header) to sort it alphabetically and paste it back into your spreadsheet.
Frequently Asked Questions
- Alphabetical sort compares characters by Unicode code point — 'item10' comes before 'item2' because '1' (code 49) < '2' (code 50). Natural sort treats contiguous digit sequences as numbers — 'item2' correctly precedes 'item10'.
- In numerical sort mode, items that cannot be parsed as numbers are sorted to the end of the list. A warning is shown listing the non-numeric items.
- Yes. Enable 'Natural sort' — it handles IP address components (192.168.1.10 sorts after 192.168.1.2 correctly).
- Yes. The shuffle uses the Fisher-Yates algorithm with random values from window.crypto.getRandomValues() for unbiased, cryptographically random shuffling.