Line Sorter (Z–A): What Descending Really Means
Showing a list from Z to A, or working backwards through a keyword list, is more reliable with a reverse sort than with manual cut and paste.
Open the tool:Line Sorter (Z–A)
When you actually need it
Reverse alphabetical order is the direct use: a directory printed back to front, or a check that starts with the entries beginning with W, X, Y, and Z. Comparing the result with an ascending sort is also a quick way to confirm whether an item is in the list at all.
Remember that it sorts characters, not numbers or dates. Numeric IDs are compared character by character, so 19 comes before 2, the opposite of numeric order. Dates only sort correctly when written as 2024-03-01; with 3/1/2024 the character order no longer matches time order.
- Presenting a list from Z to A
- Searching from the end of the alphabet
- Cross-checking against an ascending sort
How it works, and where it surprises
The tool sorts ascending and then reverses the whole result, so the output is an exact mirror. Lines with identical content also swap relative order, so add a row number first if the original sequence matters.
Blank lines end up last, since they come first when ascending. Capitals still have lower code points than lowercase, but the whole order flips: lowercase first, capitals after. Chinese lines are reversed by code point, which is not reversed pinyin. Leading spaces and list markers still shift a line.
- The output mirrors the ascending sort
- Blank lines end up at the bottom
- Lowercase first, capitals after
Alternatives and when not to use it
To sort by date, score, or price, use a spreadsheet column sort, which understands numeric and date types. To invert the current sequence without reordering anything, use the line reverser; the two produce very different output.
Natural order, where item 2 precedes item 10, or pinyin and gojuon order, needs localeCompare in a script or the matching spreadsheet option. This tool compares characters and does not guess intent. It compares characters and never guesses what you meant by the numbers.
FAQ
Is the descending result just the ascending one reversed?
Yes. The tool sorts ascending and then reverses everything, so it is an exact mirror, including the relative order of identical lines. Add row numbers first if you need a stable order.
Why are the numbers not in numeric order?
Characters are compared, not values. The first character of 19 is 1, which is smaller than 2, so it sorts earlier ascending and later descending. Use a spreadsheet for numeric order.
Can I sort dates newest first?
Only when dates are written in a zero-padded form such as 2024-03-01, where character order equals time order. Other formats such as 3/1/2024 sort wrongly, so use the date sort in a spreadsheet.
Related tool:Line Sorter (Z–A)