In this article
What Is Punycode?
Punycode is an encoding syntax defined in RFC 3492 that converts Unicode characters into a limited ASCII character set used by the Domain Name System (DNS). It enables internationalized domain names (IDN) — domain names containing non-ASCII characters like accents, Chinese characters, or Arabic script — to work within the ASCII-only DNS infrastructure.
A Punycode-encoded domain is prefixed with xn-- (the ACE prefix) to signal that it contains encoded Unicode. For example, the domain munchen.de becomes xn--mnchen-3ya.de in Punycode. A Punycode converter translates between the human-readable Unicode form and the DNS-compatible ASCII form.
How Punycode Encoding Works
Punycode uses a bootstring algorithm to represent Unicode code points as a sequence of basic ASCII characters (a-z, 0-9, and hyphens).
- Unicode separation — the encoder identifies which characters are basic ASCII (passed through unchanged) and which are non-ASCII (need encoding)
- Delta encoding — non-ASCII characters are encoded as numeric deltas representing their position and code point, compressed into base-36 digits
- ACE prefix — the final encoded string is prefixed with xn-- to mark it as Punycode, producing the ACE (ASCII Compatible Encoding) form used by DNS
Try it free — no signup required
Convert Punycode →When To Use Punycode
Punycode conversion is needed whenever you work with internationalized domain names in systems that only support ASCII.
- Domain registration — registrars require the Punycode form to register IDN domains, and WHOIS lookups use the xn-- encoded form
- Email with international domains — email addresses like user@munchen.de must be converted to user@xn--mnchen-3ya.de for SMTP delivery
- DNS configuration — DNS zone files and records use the Punycode form for any domain label containing non-ASCII characters
Frequently Asked Questions
Is Punycode the same as URL encoding?
No. URL encoding (percent-encoding) converts characters to %XX hex sequences for use in URL paths and query strings. Punycode specifically encodes Unicode domain labels into ASCII for DNS. They solve different problems — URL encoding is for URLs, Punycode is for domain names.
Can Punycode be used for phishing?
Yes, this is known as an IDN homograph attack. Attackers register domains with Unicode characters that look identical to Latin letters (e.g., Cyrillic 'a' vs Latin 'a'). Modern browsers mitigate this by displaying the Punycode xn-- form for suspicious mixed-script domains.
Do all browsers support internationalized domain names?
Yes. All modern browsers automatically convert IDN domains to Punycode for DNS resolution and display the Unicode form in the address bar. The conversion is transparent to users. However, browsers may show the Punycode form for domains that mix scripts as a phishing protection measure.