German Alphabetical Sort

Sort with ä=ae, ö=oe, ü=ue OR after z per DIN 5007-1/-2

Sort German word and name lists correctly using DIN 5007-1 (umlaut treated as its base vowel) or DIN 5007-2 (umlaut expanded to ae, oe, ue), with ß handled as ss in both rules — for dictionaries, phone books and indexes.

What is the difference between DIN 5007-1 and DIN 5007-2?

DIN 5007-1 is the dictionary rule: umlauts sort exactly like their base vowel, so ä = a, ö = o and ü = u. DIN 5007-2 is the phone-book rule: umlauts expand to two letters, so ä = ae, ö = oe and ü = ue, which separates names like Müller and Mueller.

Alphabetising German text is not as simple as a plain Unicode sort, because the umlauts ä, ö, ü and the sharp-s ß have no fixed position in the basic Latin order. Germany’s DIN 5007 standard defines two accepted rules, and which one is correct depends on whether you are building a dictionary or a name index. This tool applies either rule to a list you paste in.

How it works

Before comparing two words, each is transformed into a sort key in lowercase, then the umlauts are replaced according to the chosen rule:

DIN 5007-1 (dictionary)   ä → a   ö → o   ü → u   ß → ss
DIN 5007-2 (phone book)   ä → ae  ö → oe  ü → ue  ß → ss

The keys are then compared character by character. When two keys are equal — for example Müller and Muller both reduce to muller under DIN 5007-1 — the original spellings are used as a stable tie-break so the order stays deterministic.

Which rule to use

Use DIN 5007-1 for glossaries, dictionaries and indexes where you want Apfel and Äpfel to sit next to one another. Use DIN 5007-2 for telephone directories, customer lists and any roster of surnames, because it keeps umlaut spellings (Müller) and their ASCII variants (Mueller) collated together, which matters when people may have registered either form.

Example

Given the names Müller, Mueller, Muller and Maier, DIN 5007-1 orders them Maier, Muller, Müller, Mueller (umlaut counts as plain u, then ue follows). DIN 5007-2 orders them Maier, Mueller, Müller, Muller, pulling the ae-style spellings together. Both rules place Straße and Strasse at the same point because ß equals ss everywhere.