Punycode Encoder/Decoder

Convert international domain names to and from Punycode (ACE)

Ad placeholder (leaderboard)

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.

Ad placeholder (rectangle)