Punycode is the encoding that lets the Domain Name System — which understands only ASCII letters, digits, and hyphens — carry domain names written in any language. This tool converts an internationalised domain name (IDN) such as münchen.de to its ASCII-Compatible Encoding xn--mnchen-3ya.de, and decodes xn-- labels back to Unicode, following RFC 3492 exactly.
How it works
Punycode is a specific parameterisation of the more general Bootstring algorithm. Encoding a single label happens in two phases. First, every ASCII (basic) code point is copied straight to the output, followed by a hyphen delimiter if any basic characters were present. Second, the remaining non-ASCII code points are inserted one at a time in code-point order; for each insertion the algorithm emits a variable-length, base-36 number that encodes both which character it is and where it belongs. A self-adjusting bias keeps these numbers compact for typical inputs.
Decoding runs the process in reverse: the basic characters before the final hyphen are read directly, then each base-36 group is parsed back into a code point and its insertion position, rebuilding the original Unicode string.
Per-label processing and the xn— prefix
A domain is split on dots and each label is handled on its own. Labels that are already pure ASCII — including the top-level domain — pass through unchanged. Any label containing non-ASCII characters is Punycode-encoded and given the xn-- ACE prefix so resolvers know to decode it. That is why münchen.de becomes xn--mnchen-3ya.de rather than encoding the whole string at once.
Example
The German word bücher encodes to bcher-kva: the ASCII letters bcher are copied, a hyphen separates them, and kva is the base-36 suffix describing where the ü belongs. As a full domain, bücher.example becomes xn--bcher-kva.example. Note that visually similar characters from different scripts can produce look-alike domains, so always inspect the encoded form when a domain looks suspicious. Everything is computed locally in your browser.
Practical uses
Registering internationalised domains. Domain registrars require Punycode when submitting an IDN. If you want to register café.com, your registrar may ask for xn--caf-dma.com. This tool lets you produce and verify that encoding before you submit.
DNS record entry. When adding DNS records at a registrar or nameserver that only accepts ASCII, you need the Punycode form. Enter the Unicode domain, copy the result, and paste it into the DNS panel.
Security and phishing inspection. A URL that looks like paypal.com in one script may actually be xn--paypl-mua.com using a Cyrillic letter that resembles a Latin a. Decoding the xn-- label in your browser bar reveals the true characters. Modern browsers display the Punycode form for mixed-script or confusable labels precisely to prevent this.
Email headers. Internationalised email addresses (RFC 6530) place the domain through the same encoding when the mail transport is ASCII-only. Debugging such addresses often requires knowing the Punycode equivalent.
Common IDN encodings
| Unicode label | Punycode label |
|---|---|
| münchen | xn—mnchen-3ya |
| bücher | xn—bcher-kva |
| 日本語 | xn—wgv71a309e |
| москва | xn—e1afmkfd |
| مثال | xn—mgbh0fb |