Last updated
Punycode Quick Reference
- ACE prefix:
xn--identifies a Punycode-encoded DNS label - Scope: Only non-ASCII labels are encoded; ASCII labels pass through unchanged
- TLDs: Country-code TLDs can also be internationalized (e.g.,
.рфfor Russia =xn--p1ai) - Case: Punycode is case-insensitive;
XN--andxn--are equivalent - Length limit: Each DNS label is limited to 63 characters (including the xn-- prefix)
- Security: Always verify Punycode form when clicking links in emails to detect homograph attacks
Examples
Example 1: Chinese Domain Name
Unicode (IDN): 中文.com
Punycode: xn--fiq228c.com
Unicode (IDN): 中国.com
Punycode: xn--fiqs8sirgfmh.com
Unicode (IDN): 北京.com
Punycode: xn--1lq90ic7f1rc.com
The xn-- prefix identifies an ACE (ASCII-Compatible
Encoding) label. DNS servers see only the Punycode form.
Browsers display the Unicode form in the address bar.
Example 2: European Language Domains
German:
münchen.de → xn--mnchen-3ya.de
düsseldorf.de → xn--dsseldorf-q9a.de
straße.de → xn--strae-oqa.de
French:
café.fr → xn--caf-dma.fr
île-de-france.fr → xn--le-de-france-bhb.fr
Spanish:
españa.es → xn--espaa-rta.es
niño.es → xn--nio-8ma.es
Swedish:
göteborg.se → xn--gteborg-n4a.se
malmö.se → xn--malm-0ra.se
Note: Only the non-ASCII labels are encoded.
Labels with only ASCII characters pass through unchanged.
Example 3: Arabic and Hebrew Domains
Arabic:
مثال.com → xn--mgbh0fb.com
السعودية.sa → xn--mgberp4a5d4ar.sa
Hebrew:
ישראל.il → xn--4dbcagdahymbxekheh6e0a7fei0b.il
Japanese:
日本語.jp → xn--wgv71a309e.jp
東京.jp → xn--1lqs71d.jp
Korean:
한국.kr → xn--3e0b707e.kr
서울.kr → xn--oi2b30g3ueowi6mjktg.kr
Russian (Cyrillic):
россия.рф → xn--h1alffa9f.xn--p1ai
москва.рф → xn--e1afmapc.xn--p1ai