This tool sorts Portuguese words, names, and phrases into correct alphabetical order. Portuguese has a rich set of accented vowels and the cedilla, and naive byte or ASCII sorting pushes them to the wrong place. Here they sort exactly where a Portuguese reader expects, following the official Unicode ordering.
How it works
The tool delegates to the browser’s Intl.Collator configured with the
Portuguese locale, which implements the Unicode CLDR Portuguese collation. In
that collation, accented vowels and ç carry the same primary weight as their
base letter:
a = á = à = â = ã (primary level)
c = ç
e = é = ê
o = ó = ô = õ
So maçã and maca compare equal at the primary level and only the diacritic
breaks the tie at a secondary level. The result is that accented words interleave
naturally with unaccented ones instead of being dumped after z. Options let you
choose case ordering, enable numeric (natural) order so item2 precedes
item10, and reverse to descending.
Tips and example
Given the input maçã, maca, árvore, avó, avô, ano, the Portuguese collation
produces ano, árvore, avô, avó, maca, maçã — árvore sorts under a, and the
avô/avó pair is separated only by their final accent. Use the numeric option
for file names or codes that mix words and numbers, and keep case ordering on
default unless you specifically need uppercase or lowercase to lead.