Punycode Encoder / Decoder

Convert internationalized domain names to and from Punycode (xn-- prefix) using the Bootstring algorithm.

Conversion Reference
münchen.dexn--mnchen-3ya.de
例え.jpxn--r8jz45g.jp
café.comxn--caf-dma.com

Frequently Asked Questions

Punycode is a representation of Unicode using the limited ASCII character set used for Internet hostnames. It allows internationalized domain names (IDN) containing non-ASCII characters to be encoded in a way compatible with the Domain Name System.
The 'xn--' prefix (called ACE prefix) identifies a domain label as Punycode-encoded. For example, 'münchen.de' becomes 'xn--mnchen-3ya.de'. Each label of a domain name is encoded separately.
The DNS protocol only supports ASCII characters. Punycode bridges the gap by encoding Unicode domain names into ASCII-compatible form, enabling people worldwide to use domain names in their native scripts and languages.
Bootstring is the general algorithm behind Punycode, defined in RFC 3492. It efficiently encodes Unicode strings by separating ASCII characters from non-ASCII ones and encoding the positions and code points of non-ASCII characters using a variable-length integer representation.
Punycode can encode any Unicode string, but it is primarily designed for domain name labels. Each label (part between dots) is encoded independently, and the encoding is most efficient for strings that are mostly ASCII with a few non-ASCII characters.