Text Sorter guide
Reorder a newline-separated list alphabetically, numerically, or by line length while keeping the result easy to inspect and copy.
What this tool does
The Text Sorter splits input at each line break and sorts the resulting lines with the browser's Intl.Collator. Natural numeric comparison is enabled, so values such as item 2 can appear before item 10 instead of being treated as plain character sequences. Ascending, descending, shortest-first, and longest-first orders are available.
Case-sensitive mode asks the collator to distinguish letter variants. When it is off, uppercase and lowercase versions compare at the same base sensitivity. The blank-line option removes lines that contain no visible text before sorting. Lines are rearranged as complete strings; the tool does not split comma-separated values or parse table columns.
How to use it
- Place one complete item on each line.
- Choose alphabetical, reverse, shortest, or longest order.
- Decide whether letter case should affect comparison.
- Choose whether blank lines should be removed.
- Select Sort lines, inspect the order, and copy the result.
Benefits
- Locale-aware comparison through the browser collator
- Natural ordering for numbers embedded in text
- Alphabetical and length-based sort modes
- Optional case sensitivity and blank-line removal
- Original line contents preserved during reordering
Understanding sort behavior
Alphabetical results can vary slightly by browser language because Intl.Collator follows locale-aware comparison rules rather than a fixed ASCII table. This usually produces more natural human ordering for letters, accents, and embedded numbers. For software systems that require byte-level or code-point ordering, use a developer-specific comparator instead.
Length modes count JavaScript string units, including spaces and punctuation. They use alphabetical comparison to produce a stable-looking order when two lines have the same length. Duplicate lines are retained; use Duplicate Line Remover before or after sorting when each value should appear only once.