Text toolsSort lines

Sort lines

Reorder line-based text alphabetically, numerically, by length, or in reverse order.

Ready to clean
Your text never leaves this device
0 characters · 0 words
0 characters · 0 words
A focused cleanup

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.

  1. 1
    Paste 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.

  2. 2
    Pick 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.

  3. 3
    Clean 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

Alphabetizing references
Ordering numeric data
Sorting lists by length

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.

Good to know

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.