Portuguese Alphabetical Sort

Sort Portuguese words with correct ã/â/á ordering per Unicode CLDR

Sort lists of Portuguese words and names in correct alphabetical order using the Unicode CLDR Portuguese collation, where accented vowels and ç sort as variants of their base letter. Supports case, numeric, and descending order. Runs in your browser.

How does Portuguese alphabetical order treat accents?

In the Unicode CLDR Portuguese collation, accented vowels such as ã, â, á, à, é and ô sort as variants of their base vowel, and ç sorts with c. So maçã sits next to maca rather than after z. Accents only decide order when two strings are otherwise identical.

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.