Text Sorter
Sort lines alphabetically, numerically, or in reverse order. Your work stays on this device whenever possible.
How to use Text Sorter
- Paste one item per line into "Lines to sort"; a sample of Apple, Orange 10, orange 2 and Banana is preloaded.
- Choose "Sort by": A to Z, Z to A, Natural, Numeric, Line Length, Reverse Current Order or Randomize / Shuffle Lines.
- Set "Empty lines" to keep, remove, trim spaces, or trim spaces and remove empty lines.
- Tick "Case-sensitive" and "Remove duplicate lines" if required.
- Press "Sort lines" and read the "Sort Statistics" block appended below the sorted list.
Worked example
Using the preloaded lines with Case-sensitive unticked: Natural Sort (A1, A2, A10) returns Apple, Banana, orange 2, Orange 10. Alphabetical (A → Z) returns Apple, Banana, Orange 10, orange 2, because the character "1" sorts before "2". The statistics block reports Input lines 4 in both cases.
When to use this tool
- Ordering version labels like v1.2, v1.9 and v1.10 as a human would.
- Ranking a list of slogans from shortest to longest.
- Shuffling a class roster to decide presentation order.
Important limitations
Operates on text line-by-line in memory. Lines containing heterogeneous numeric formats, mixed unicode scripts, or thousands of empty rows can be sanitized with the built-in empty-line filter policy.
Frequently asked questions
What is the difference between Alphabetical and Natural sort?
Alphabetical compares character by character, so "Orange 10" lands before "orange 2". Natural sort reads digit runs as numbers, so 2 comes before 10 and file2 comes before file10.
How does Numeric sort treat lines with no number?
It reads the number at the start of each line with parseFloat, so "12 apples" sorts as 12. A line that does not begin with a number counts as 0, and "1,000" is read as 1.
Does the Case-sensitive box affect duplicates?
It affects A-Z, Z-A and Natural comparisons only. Duplicate removal always requires an exact match, so "apple" and "Apple" both stay. The Duplicate Line Remover can ignore case.
How are ties handled in Line Length?
Shorter lines come first for ascending order, and lines with equal length are then ordered alphabetically. Descending order reverses that, so the longest line leads and ties still fall back to alphabetical order within equal lengths.
Is the shuffle suitable for a prize draw?
It is a Fisher-Yates shuffle intended for games and classroom use. Nothing in the tool claims it is audited or cryptographic, so do not use it where fairness must be provable.