Cadmeo

ABC Order Generator

One item per line. Blank lines are dropped.

Sorted list

:

0
Lines in
0
Lines out
0
Duplicates removed

The ABC order generator sorts a list one item per line, A to Z or Z to A. Sorting uses locale-aware comparison rather than raw character codes, which is the difference between accented words landing beside their unaccented spelling and being dumped at the end of the list.

How it works

Comparison runs through Intl.Collator rather than a plain string comparison. A raw comparison sorts by Unicode code point, which puts every capital letter before every lowercase letter and pushes accented characters past Z entirely.

  • Case sensitivity off: apple and Apple sort together, which is what most lists want.
  • Case sensitivity on: capitals sort before lowercase, matching a code-point sort more closely.
  • Numeric ordering is always on, so item 2 sorts before item 10 rather than after it.
  • Blank lines are dropped, and leading and trailing spaces are trimmed before comparison.

Examples

Mixed case with a duplicate

List

banana
Apple
cherry
apple

Case sensitive

No

Remove duplicates

Yes

Result

Apple
banana
cherry

With case sensitivity off, Apple and apple compare as equal, so the duplicate check removes the second one and keeps the first occurrence. Four lines in, three out, one duplicate removed.

Numbered items

List

item 10
item 2
item 1

Order

A to Z

Result

item 1
item 2
item 10

Numeric collation reads the digits as numbers, so item 10 sorts last. A plain string sort would place item 10 second, because the character 1 comes before 2.

Accented words

List

zebra
élan
eagle

Order

A to Z

Result

eagle
élan
zebra

Locale-aware comparison treats é as a variant of e, so élan sorts between eagle and zebra. Sorting by code point would place élan after zebra, because é sits far above z in Unicode.

Frequently asked questions

Why does the ABC order generator sort accented words differently from a spreadsheet?

Both use locale-aware collation, but they may use different locales. This tool sorts with the English collation, where é is treated as a variant of e. A spreadsheet set to a Scandinavian locale sorts several accented letters as separate letters after z, which is correct for that language.

What does turning case sensitivity on actually change?

It makes capitals sort before lowercase, so Apple, Banana, apple, banana. With it off, the two spellings of apple sort together, and the duplicate remover treats them as the same word.

Does it sort numbers correctly?

Yes. Numeric collation is always on, so item 2 comes before item 10. This is the one behaviour that catches people out in plain text sorts, where 10 sorts before 2.

Which line survives when duplicates are removed?

The first occurrence in your original input, before sorting. If your list has apple then Apple with case sensitivity off, you keep apple.

Compared with