Romanian Alphabetical Sort

Sort Romanian with ă, â, î, ș, ț in their correct positions

Sort a list of Romanian words using the CLDR Romanian collation, placing ă after a, â after ă, î after i, and ș/ț after s/t as primary letters rather than folded accents.

How is this different from a plain alphabetical sort?

A naive ASCII sort scatters ă, â, î, ș and ț to the end or treats them like plain a, i, s, t. Romanian collation gives each its own primary position next to the base letter.

This tool sorts a list of Romanian words the way a Romanian dictionary or phone book would, putting the diacritic letters ă, â, î, ș and ț in their correct alphabetical positions instead of dumping them at the end.

How it works

The tool uses the browser’s native Intl.Collator with the Romanian (ro) locale, which implements the CLDR Romanian collation tailoring. In Romanian these accented letters are primary distinctions, not accent variants to be folded away:

  • ă sorts immediately after a, and â immediately after ă
  • î sorts immediately after i
  • ș sorts after s, and ț after t

So the alphabet order used for comparison is roughly: a · ă · â · b · … · i · î · … · s · ș · t · ț · …. Each line is trimmed, empty lines are dropped, and the remaining words are compared pairwise with the collator.

Example

Given the words bară, animal, ăsta, îngheț, șurub, tată, țară, soare, the Romanian sort yields animal, ăsta, bară, idee, îngheț, soare, șurub, tată, țară — note ăsta landing right after animal and before bară, and țară after tată.