Norwegian alphabetical order is not the same as a plain Unicode or English sort. The three extra letters æ, ø and å belong at the end of the alphabet, after z, and getting that wrong scrambles name lists and indexes.
How it works
The tool sorts your lines using Norwegian collation:
- Where the browser supports it, an
Intl.Collatorwith the Norwegian locale provides the correct ordering directly. - As a fallback, a manual weight table assigns a–z the weights 1–26 and gives æ, ø and å the weights 27, 28 and 29, so they always follow z.
Comparison is case-insensitive, and blank lines are stripped before sorting.
Example and notes
Given Åse, Anne, Øyvind, Æsa, Bjørn, Zakarias, the Norwegian order is Anne, Bjørn, Zakarias, Æsa, Øyvind, Åse. Notice that Åse lands last and the three special letters keep their fixed æ–ø–å order. This is the standard ordering shared with Danish; Swedish instead ends its alphabet with å, ä, ö.