Word and Text Tools
Word and Text Tools › Clean up and compare text › Sort lines Z to A

Sort lines Z to A

Puts a list in reverse alphabetical order, so the entry that comes last in a dictionary is first.

What it doesPuts a list in reverse alphabetical order, so the entry that comes last in a dictionary is first.
Exact ruleThe comparison is the same as on the A to Z page but run backwards: blank lines are dropped, entries are compared by lower-case form, then by exact text, one Unicode code point at a time.
Example textpear ⏎ Apple ⏎ banana ⏎ apple ⏎ Cherry
Example resultpear ⏎ Cherry ⏎ banana ⏎ apple ⏎ Apple
LimitsNumbers are compared as text, so 10 still sits next to 1 rather than after 9, and an accented letter lands at the top because it is numbered after z.
Where it runsIn your browser: your text is never uploaded, stored or logged.

Related tools

Remove extra spaces Remove line breaks Remove duplicate lines Sort lines A to Z Reverse text Reverse line order Find and replace Text compare (diff)

All tools in Clean up and compare text

How to use the sort lines Z to A

  1. Paste one entry per line.
  2. Read the result from the top: the highest name is first.
  3. Copy it, or switch to the A to Z page for the usual order.

How it works

The comparison is the same as on the A to Z page but run backwards: blank lines are dropped, entries are compared by lower-case form, then by exact text, one Unicode code point at a time.

Numbers are compared as text, so 10 still sits next to 1 rather than after 9, and an accented letter lands at the top because it is numbered after z.