Punycode converter for internationalized domains
Punycode is the encoding from RFC 3492 that lets internationalized domain
names (IDNs) — those with accents or non-Latin scripts — work with the ASCII-only
DNS. This tool converts a Unicode domain into its xn-- ASCII form and decodes it
back, useful for developers, registrars and anyone inspecting an unfamiliar
xn-- domain.
How it works
The converter implements the full Bootstring algorithm and processes a domain one dot-separated label at a time:
encode: each label with non-ASCII chars → "xn--" + bootstring encoding
decode: each "xn--" label → original Unicode characters
plain ASCII labels are left unchanged
Handling labels separately is why a multi-part domain round-trips cleanly.
Example
Encoding münchen.de:
münchen(contains ü) → xn—mnchen-3yadeis ASCII → unchanged- Result: xn—mnchen-3ya.de
Decoding the same value returns münchen.de.
| Direction | Input | Output |
|---|---|---|
| Encode | münchen.de | xn—mnchen-3ya.de |
| Decode | xn—mnchen-3ya.de | münchen.de |
| Encode | example.com | example.com (unchanged) |
When you actually need this
The most common real-world use cases:
As a developer: You are building a user-registration flow that accepts email addresses or domains in any script. When you store or resolve the domain, you need the ASCII-compatible form. Calling a Punycode encoder on the domain portion before your DNS lookup ensures the resolver sees a valid hostname regardless of what the user typed.
Inspecting suspicious links: A phishing email may contain a link that looks like аррlе.com but uses Cyrillic characters that are visually identical to Latin letters. Pasting the domain here decodes it instantly and reveals the non-Latin characters — a technique called homograph attack detection.
Registrar workflows: Internationalized domain registrars display the Unicode form to users but submit the xn— form to the registry. If you are integrating with a registrar API, you may need to convert between the two depending on which form their endpoints expect.
Certificate debugging: TLS certificates for IDNs list the Punycode form in the Subject Alternative Name field. If a domain fails cert validation, checking whether you are comparing the Unicode and Punycode forms rather than the same representation is a useful first step.
Edge cases worth knowing
- A label that is already pure ASCII — including
exampleandcom— passes through unchanged in both encode and decode directions. - Punycode is case-insensitive in the ASCII output;
xn--mnchen-3yaandXN--MNCHEN-3YAare equivalent per DNS convention. - The algorithm encodes the label, not the separator dots. Each segment between dots is handled independently, which is why
münchen.berlín.deencodes toxn--mnchen-3ya.xn--berln-kra.de. - Bidirectional text (Arabic, Hebrew) and mixed-script labels are valid Unicode but demand care: ICANN’s IDNA2008 protocol adds further restrictions beyond what RFC 3492 alone defines.
Everything runs locally in your browser.