Skip to main content
NyankoTools

Punycode Converter (IDN Domain to xn-- and Back)

Convert domain names with non-ASCII characters (internationalized domain names, IDN) to the "xn--" Punycode form used in DNS, or turn Punycode back into readable text. To encode a whole URL, use the URL Encoder/Decoder.

🔒 Runs in your browser · Your data is never sent to a server

How to use

  1. Choose "Unicode → Punycode" or "Punycode → Unicode" under "Direction".
  2. Under "Target", pick "Domain" to convert a whole domain name, or "Raw string" to convert a single string without dots.
  3. Type or paste into "Input" and the converted text appears in "Result". Use "Copy" to copy it.

Notes

  • Domains are converted label by label (split at dots, including the ideographic and fullwidth dots). Only labels with non-ASCII characters get the "xn--" prefix; plain ASCII labels are left as they are.
  • Labels with non-ASCII characters are normalized to NFKC and lowercased first. This is not a complete implementation of the browser IDN rules (UTS #46).
  • "Raw string" handles only the RFC 3492 Punycode itself and does not add "xn--".
  • A label may be up to 63 characters and the whole domain up to 253 after conversion. Longer results are reported as errors.
  • Look-alike (homograph) detection is not performed. For a suspicious URL, check its "xn--" form to be safe.

Glossary

Punycode

An encoding (RFC 3492) that represents Unicode text using only letters, digits and hyphens. It is how non-ASCII characters are put into domain names.

IDN (internationalized domain name)

A domain name containing non-ASCII characters such as Japanese or Chinese. In DNS it is stored as Punycode starting with "xn--".

xn--

The prefix (ACE prefix) that marks a domain label as Punycode-encoded.

FAQ

Why do internationalized domain names start with "xn--"?

DNS only handles letters, digits and hyphens, so names with Japanese or other non-ASCII characters are converted to ASCII with Punycode. The "xn--" prefix marks a converted label. The address bar may show the readable form, but the network uses the "xn--" form.

What is the difference between "Domain" and "Raw string"?

"Domain" converts each dot-separated label and adds "xn--" only to labels with non-ASCII characters (münchen.de becomes xn--mnchen-3ya.de). "Raw string" converts only the RFC 3492 Punycode itself, without the prefix (münchen becomes mnchen-3ya).

Does uppercase or fullwidth input change the result?

Labels that contain non-ASCII characters are normalized to NFKC and lowercased before encoding, so "ABCü" is encoded as "abcü". Pure ASCII labels and "Raw string" conversions are used exactly as typed.

Why does decoding say a character is not valid?

Punycode only uses letters, digits and hyphens. Check that there are no symbols or non-ASCII characters after "xn--" and that the string is not cut off. In "Raw string" mode, "xn--" is treated as part of the string, so remove the prefix or use "Domain".

Share this page

↑↓ Select Enter Open Esc Close