Punycode Encoder

Encoders & Decoders

How to use the Punycode Encoder

Encode a Unicode domain in two steps:

1

Type or paste the Unicode domain

Enter any internationalized domain name containing non-ASCII characters (e.g. münchen.de, 例え.jp, привет.рф). Or click one of the four example buttons.

2

Copy the Punycode result

The ACE-encoded domain appears instantly. Labels containing non-ASCII characters are prefixed with xn--. The label breakdown table shows which labels were encoded and which were already ASCII. Click Copy to copy the result.


When to use this tool

Use Punycode encoding to convert Unicode domain names for DNS and system compatibility:

  • Converting an internationalized domain name to its xn-- ASCII form before using it in DNS configuration, email headers, or SSL certificate requests
  • Finding the DNS-compatible ASCII version of a Unicode domain for use in server configurations and firewall rules
  • Verifying what ACE form a Unicode domain resolves to before registering it through a domain registrar
  • Encoding emoji or non-ASCII domain names for use in HTTP requests, SSL/TLS configurations, or nginx server blocks
  • Converting a multilingual domain to its xn-- form for use in SPF, DKIM, or DMARC email authentication records
  • Educational exploration of how international domain names work at the DNS level and how RFC 3492 encodes Unicode

Frequently asked questions

Q:What is Punycode and why does it exist?
Punycode (RFC 3492) is an encoding algorithm that converts Unicode strings into ASCII strings compatible with the Domain Name System (DNS). DNS was designed before Unicode existed and only supports ASCII labels. Punycode solves this by representing each Unicode label (e.g. münchen) as an ASCII string with a special xn-- prefix (e.g. xn--mnchen-3ya). This allows internationalized domain names (IDN) to work within the existing DNS infrastructure without modifying DNS servers.
Q:What does the xn-- prefix mean?
The xn-- prefix (ACE prefix — ASCII Compatible Encoding) signals to DNS resolvers and applications that the following label is a Punycode-encoded Unicode string rather than a regular ASCII label. Any domain label starting with xn-- is treated as IDN and decoded before being displayed to users. The xn-- prefix itself is two letters, two hyphens, and a total of 4 characters — chosen to be unique and unlikely to conflict with existing domain labels.
Q:How does the Punycode algorithm work?
The RFC 3492 algorithm encodes a Unicode label in two parts. First, all ASCII characters in the label are output directly followed by a delimiter hyphen. Then, each non-ASCII Unicode code point is encoded using a variable-length base-36 encoding that compactly represents the position and value of each non-ASCII character relative to an adaptive bias. The result is a pure ASCII string that uniquely and reversibly represents the original Unicode label.
Q:Are all domain labels encoded or only the non-ASCII ones?
Only labels (the dot-separated parts of a domain) that contain non-ASCII characters are Punycode-encoded and prefixed with xn--. Labels that are already pure ASCII are passed through unchanged. For example, in münchen.de: the label münchen contains ü (non-ASCII) and becomes xn--mnchen-3ya, but de is already ASCII and stays as de — giving xn--mnchen-3ya.de. The per-label breakdown in the tool shows exactly which labels were encoded.
Q:Can I encode emoji domains?
Yes — emoji are valid Unicode characters and can appear in internationalized domain names in some registries. For example, the domain 🍕.ws or ☺.com can be registered and encoded to Punycode. The encoder handles any Unicode code point including emoji in the supplementary planes (U+1F000 and above). Be aware that emoji domain support varies by registrar and country code TLD — check with the specific registry before registering.
Q:Is Punycode encoding the same as URL encoding?
No — they are completely different. Punycode (RFC 3492) converts Unicode text to an ASCII representation using a mathematical encoding algorithm and the xn-- prefix. URL percent-encoding (RFC 3986) replaces individual characters with %XX hexadecimal sequences. Punycode is used specifically for domain name labels. URL encoding is used for path and query string characters. A URL with an internationalized domain uses Punycode for the host part and percent-encoding for any special characters in the path or query.