Text Sorter
Sort lines alphabetically, numerically, by length, reverse, or shuffle — with dedupe and trim. Fast and fully private in your browser.
Use this free text sorter to alphabetize a list, order numbers, sort by line length, reverse the order, or shuffle lines at random. Built-in options let you trim whitespace, remove blank lines, and drop duplicates in the same pass — so a messy pasted list becomes clean, ordered output instantly.
How to use it
No account, no upload — it all happens on your device.
What you can do with a text sorter
Everyday list-wrangling that is tedious by hand.
- Alphabetize anything. Names, tags, imports, CSV columns, or a grocery list — get them in A→Z or Z→A order in one click.
- Sort numbers correctly. Plain text sorting puts “10” before “2”. Numeric mode reads the value on each line and orders it the way you expect.
- Deduplicate a list. Combine sort with Remove duplicates to collapse a list down to its unique entries.
- Randomize fairly. Shuffle mode reorders lines for draws, sampling, or randomized test data.
Worked examples
The same five lines under different sort orders.
| Mode | Input | Output |
|---|---|---|
| A → Z | banana, Apple, cherry | Apple, banana, cherry |
| Numeric 0 → 9 | 10 apples, 2 oranges, 1 pear | 1 pear, 2 oranges, 10 apples |
| Longest first | fig, apple, kiwi | apple, kiwi, fig |
Alphabetical vs. numeric: why order can surprise you
Understanding text order prevents the classic “10 before 2” bug.
Computers sort text character by character. Under plain alphabetical order, "10" sorts before "2" because the character "1" comes before "2" — the same reason file names like img10.png appear before img2.png in some lists. Numeric mode fixes this by comparing the actual number on each line. When a line has no number, it is pushed to the end so your numbered items stay together. Case sensitivity works the same way: with it off, “apple” and “Apple” are treated as equal, which is usually what you want for human-readable lists.