About Punycode IDN
Encode unicode domains (<code>héllo.com</code>, <code>例え.jp</code>) to Punycode (<code>xn--hllo-bpa.com</code>, <code>xn--r8jz45g.jp</code>) and back. Per-label conversion (the <code>.com</code> stays ASCII). Useful when registering an IDN, parsing email addresses with non-ASCII domains, or auditing potential homograph attacks.
What Punycode encodes
The DNS protocol predates Unicode by decades. To support domains in any language without breaking the wire format, IDN (RFC 5891) defines an ASCII encoding called Punycode (RFC 3492). Per-label, the unicode form encodes to xn--<encoded>.
Modern browsers and email clients convert at the boundary — humans see Unicode, the network sees ASCII.
Common workflows
Register an IDN. Pick the unicode domain you want, encode to Punycode, register the encoded form at your registrar.
Audit DNS records. A hostname starting with xn-- is an IDN — decode to see the human-readable form. Useful when reviewing certificate transparency logs or domain reports.
Detect homograph risks. Decode an IDN, inspect the codepoints. Mixed Latin / Cyrillic in one label is a red flag.
Process email at scale. Email logs contain Punycode domains. Decoding makes them readable for analysis.
Mixed-script detection
Browsers protect against homographs by showing Punycode when a label mixes scripts (Cyrillic + Latin). The tool flags potential homograph cases so you can verify before trusting an IDN domain.
Frequently asked questions
Why does <code>héllo.com</code> need conversion?
xn--. Browsers and email clients display the unicode form to humans.What is a homograph attack?
аpple.com. Browsers detect mixed scripts and show the punycode form to flag suspicion.Can <code>.com</code> be unicode?
How does email handle this?
name@) follows different rules (RFC 6531 EAI). The domain part follows IDN. Most modern mail stacks convert to Punycode for SMTP transport.Browser display?
For emoji domains?
💩.la is a real (now defunct) emoji domain. Encodes to xn--ls8h.la.What does xn--6ii decode to?
xn--6ii (or just the 6ii label) above and the tool shows its exact Unicode character — Punycode maps the encoded suffix back to the original codepoint. Because a single label can encode an unusual or non-printing character, always decode it in a tool rather than guessing; that is also how you check a suspicious xn-- domain before trusting it.How do I replace the deprecated punycode module in Node.js?
punycode module has been deprecated (DEP0040) for years. Switch to the userland punycode/ package on npm (note the trailing slash) — same API, punycode.toASCII() / toUnicode() — or use the platform URL API and new URL(...).hostname, which handles IDN automatically. This tool does the conversion without any dependency.Related tools
Last updated: 2026-07-04