IDN converter (Punycode)
The conversion runs in the browser and requires JavaScript. A fixed example is shown.
-
Label 1
- Unicode
münchen- ASCII (Punycode)
xn--mnchen-3ya- ASCII length (characters)
14
-
Label 2
- Unicode
de- ASCII (Punycode)
de- ASCII length (characters)
2
- The length is valid: each label is up to 63 characters, and the full name is up to 253 characters.
Everything runs in your browser; nothing is sent or stored.
- In the "Conversion direction" section, choose "Automatic detection", "Convert to Punycode", or "Convert to Unicode".
- Enter a domain, a URL, or an email address. For a URL, the result includes only the host name, without the path and parameters.
- For an email address, only the domain is converted, and the part before the @ character stays unchanged.
- The "Breakdown by label" section shows the Unicode form, the ASCII form, and the ASCII length of each label.
- The "Length check" section shows a note when a label or the full name exceeds the maximum length.
- In DNS records and in many technical systems, such as server settings and SSL certificates, an internationalized domain is written in Punycode form, which starts with xn--.
- Mixing scripts in the same label, such as Latin and Cyrillic letters, may be rejected by domain registries and browsers. Use one script in each label.
- Copy the result by clicking "Copy".
What is Punycode
Domain names in DNS are limited to English letters, digits, and the hyphen, so a domain in any other language is stored in DNS in ASCII form. Punycode, the encoding defined in RFC 3492, converts text in any language to ASCII characters, and the IDNA standard adds the xn-- prefix to each encoded label. Each label, meaning each part between the dots, is encoded separately: the label bücher is encoded as xn--bcher-kva, while a label in English letters only, such as example, stays unchanged. A domain that includes non-ASCII characters is called an IDN (internationalized domain name).
Where the Punycode form is used
Browsers usually display an internationalized domain in its original script, but DNS records, SSL certificates, and configuration files use the Punycode form of the domain name. For example, a CNAME or MX record that points to an internationalized domain must contain the form that starts with xn--. When a system shows a domain name that starts with xn--, for example in a log file or an error message, converting it back to the original script lets you recognize the domain.
Length limits
A label can be up to 63 characters long, and a full domain name can be up to 253 characters long. The length is checked in ASCII form, not in the original script, and a non-Latin label gets longer when it is encoded: the label παράδειγμα, 10 letters long, is encoded as xn--hxajbheg2az3al, which is 18 characters long. That is why a long label in a non-Latin script can exceed the maximum length even when it has fewer than 63 letters.
Examples
παράδειγμα.grin Punycode form:xn--hxajbheg2az3al.gr.xn--r8jz45g.jpin Unicode form:例え.jp.пример.рфa domain with a non-Latin top-level domain, in Punycode form:xn--e1afmkfd.xn--p1ai.münchen.dea domain with a Latin letter that has a diacritic, in Punycode form:xn--mnchen-3ya.de.info@bücher.examplean email address, in Punycode form:info@xn--bcher-kva.example.https://bücher.example/page?x=1a URL, from which only the host name is converted:xn--bcher-kva.example.
IDN converter (Punycode) FAQ
Are an internationalized domain and its Punycode form the same domain?
An internationalized domain and its Punycode form are the same domain, written in two forms. The browser converts the domain to Punycode before the DNS query, so both forms lead to the same site.
Why is a domain that looks Latin converted to a form that starts with xn--?
A domain is converted to the xn-- form when it includes a non-ASCII character, such as a letter with a diacritic like ü, or a letter from another script that looks like a Latin letter, such as the Cyrillic a. For example, apple.com written with a Cyrillic a is converted to xn--pple-43d.com. Swapping letters this way is used to spoof well-known domains (a homograph attack), so browsers show the Punycode form when a domain mixes scripts in a suspicious way.
Why does a message say the label contains a character that is not allowed?
The message appears when a label contains a character that is not allowed in a domain name, such as an exclamation mark or an asterisk. A label that mixes Latin letters with right-to-left letters, such as Arabic or Hebrew, may also be rejected, because the IDNA rules for right-to-left labels do not allow the mix.
Why does a message say the label cannot be decoded?
The message appears when a label that starts with xn-- is not valid Punycode, usually because a character was lost or changed when it was copied. For example, the label xn--mnchen-3y, without its last character, cannot be decoded, while the full label xn--mnchen-3ya decodes to "münchen".
Does the conversion keep uppercase letters?
Domain names are not case sensitive, so the result is shown in lowercase. For example, Example.COM appears in the result as example.com.
Can I use an email address with a non-Latin username?
An email address with a username in a non-Latin script requires SMTPUTF8 support in the mail systems of both the sender and the recipient, because the username is not converted to Punycode. That is why an address with a username in English letters and an internationalized domain works with more mail systems.