Sort lines
Reorder line-based text alphabetically, numerically, by length, or in reverse order.
How to use sort lines
Reorders lines and changes nothing else: alphabetically with numbers ordered the way a human expects, in reverse, numerically by value, or by length, with empty rows dropped unless you keep them.
- 1Paste the lines to reorder
One entry per line: references, names, numbers, tasks. Order is the only thing that changes — each retained line’s content comes through untouched, spacing included.
- 2Pick the sort mode
A to Z is alphabetical, case-insensitive, and number-aware, so "item2" precedes "item10". Z to A reverses it. Number sorts numeric lines by value. Length orders shortest to longest. Remove empty lines, on by default, drops blank rows before sorting.
- 3Clean and take the ordered list
Select Clean text, then Copy or Download the result. To deduplicate as well, remove duplicate lines pairs naturally with this tool, in either order.
When this tool is useful
Number-aware ordering, precisely
The alphabetical modes compare case-insensitively, locale-aware, and with numeric awareness on: digit runs inside lines compare by value, so "file2" sorts before "file10" instead of after it, and "apple" and "Apple" sort side by side rather than in separate case blocks. Z to A is exactly that ordering reversed.
Number mode is different: it compares each whole line as a number, for lists where every line is a value — "2" before "10", decimals and negatives included. Lines that are not plain numbers have no defined value in this mode and can land anywhere, so keep it for genuinely numeric lists; a mixed list sorts more usefully with A to Z, whose numeric awareness handles digits inside text.
Remove empty lines exists because blank rows have nowhere sensible to go in a sorted list — left in, they cluster together at one end rather than holding their places. Dropping them first is almost always what a sorted list wants, and it is a checkbox rather than a rule for the times it is not.
Sort lines questions
After it. The alphabetical modes are number-aware, comparing digit runs by value rather than character by character, so item2, item10, item100 come out in that order instead of the strict-text order item10, item100, item2.
Usually not: A to Z is number-aware, so "2" sorts before "10" even compared as text. Number mode is for purely numeric lists where value order across decimals and negatives must be exact — and it behaves unpredictably on lines that are not numbers.
No. "apple" and "Apple" sort side by side, and each line keeps its own spelling — sorting only moves lines, it never edits them.
Ordering lines shortest to longest by character count: spotting outliers in data, arranging headline or slogan candidates, or finding the longest values in an export. Lines of equal length keep their relative order.
No — every line survives, just reordered. Run remove duplicate lines before or after; the two tools are built to hand off to each other.