How the text sorter works
Sorting a list can reveal duplicates, make scanning easier, and put unordered source material into a repeatable sequence. This sorter treats each non-blank line as one item, trims surrounding whitespace, and offers alphabetical or length-based ordering without uploading the list.
Method and behaviour
Alphabetical sorting uses an English-Canadian locale-aware comparison with case-insensitive, numeric-aware behaviour. That means values such as Item 2 and Item 10 are ordered naturally instead of comparing only the first differing character. Reverse alphabetical order applies the same comparison in the opposite direction.
Length modes compare the number of JavaScript string units in each trimmed line. Lines with the same length are resolved alphabetically so the output is deterministic. Blank lines are removed before sorting.
Worked example
For the lines “Item 10”, “item 2”, “Pear”, and “apple”, A–Z sorting places apple first, then item 2, Item 10, and Pear. Numeric-aware comparison keeps 2 before 10.
Useful for
- Alphabetizing attendee, product, or keyword lists
- Ordering numbered labels naturally
- Finding unusually short or long entries
- Preparing clean line-based input for another tool
Important limitations
- This is not a spreadsheet sorter and does not understand columns
- Blank lines and outer whitespace are intentionally removed
- Language-specific dictionary order can differ from the en-CA collation used here
Questions specific to this tool
Are capital letters sorted separately?
No. The comparison is case-insensitive, while the original capitalization is preserved in the output.
What happens when two lines have the same length?
They are placed in alphabetical order to give a stable, understandable result.
Can I sort comma-separated values?
Each line is treated as one item. Put each value on its own line if you want the values sorted individually.
Reviewed by: UtilityTrove editorial team · Last reviewed: August 15, 2026 · Tool version 1.0.0