Website Spec
← Internationalisation
Optional

Internationalised Domain Names (IDN)

IDNs let domain names contain non-ASCII characters. They are encoded as Punycode on the wire and rendered as Unicode in the browser, subject to anti-spoofing rules.

What it is

Internationalised Domain Names allow labels in a hostname to contain characters outside ASCII — Cyrillic, Greek, Han, Arabic, accented Latin, and so on. münchen.de, 日本語.jp, and παράδειγμα.gr are all valid.

DNS itself only carries ASCII, so each non-ASCII label is encoded with Punycode and prefixed with xn--. The browser shows the Unicode form to the user; the resolver, certificate, and Host header see the ASCII form.

User sees:    münchen.de
On the wire:  xn--mnchen-3ya.de

The current standard is IDNA 2008 (RFC 5890–5894), with Unicode TR #46 defining the compatibility processing browsers actually use.

Why it matters

For users outside the ASCII-Latin world, a domain in their own script is more memorable, more brandable, and easier to type than a transliteration. For everyone, the security implications matter: visually similar characters across scripts ("paypal" written with a Cyrillic "а" instead of Latin "a") enable homograph attacks, where a malicious domain impersonates a real one. Browsers therefore apply display rules that decide when to show the Unicode form and when to fall back to Punycode in the address bar.

How to implement

Most sites only consume IDNs; few operate them. Either way, get the basics right.

If you own an IDN:

If your site accepts hostnames as input (email, URLs, webhooks):

Browser display rules. Chromium, Firefox, and Safari each maintain a policy: show Unicode if the label is in a single script (with a few mixed exceptions), or if the user's configured languages include that script. Otherwise show Punycode. You cannot override this from a website, and you should not try — it is the user's protection against homograph attacks. Test your IDN in each browser and accept that some users will see xn--mnchen-3ya.de.

Common mistakes

Sources