Punycode / IDN Converter
Convert internationalized domain names between Unicode and ASCII (xn--…).
Overview
Internationalized domain names (IDNs) like café.example or 日本.jp aren't transmitted in DNS as Unicode; they're encoded as ASCII strings starting with xn--. This converter handles both directions — Unicode to Punycode (the xn-- form), and Punycode back to readable Unicode.
Domain registrars, security analysts hunting for homograph phishing attacks, browser-extension developers, and anyone working with IDNs need this conversion. Punycode is also occasionally encountered in email addresses (user@xn--caf-dma.example) and IDN-aware certificates.
How it works
Punycode (RFC 3492) is a specialized encoding designed to losslessly transform a Unicode string into a sequence of ASCII characters allowed by DNS. The algorithm preserves all ASCII letters at the front, then encodes the non-ASCII code points using a bias-adjusted variable-length integer scheme. The resulting label is prefixed with xn-- so DNS knows to decode it.
Worked example: the domain "café.example" — the label "café" becomes caf-dma after Punycode encoding (the "é" is encoded as dma after the hyphen), giving the IDN label xn--caf-dma. Add the TLD and you get xn--caf-dma.example.
Examples
Unicode: münchen.de
Punycode: xn--mnchen-3ya.de
Unicode: 日本.jp
Punycode: xn--wgv71a.jp
Unicode: café.example
Punycode: xn--caf-dma.example
FAQ
Why not just send Unicode in DNS?
DNS predates Unicode and the protocol is restricted to a small ASCII alphabet at the wire level. Punycode is the standardized bridge that keeps the old protocol intact while supporting modern domain names.
What's a homograph attack?
Different Unicode characters can look identical (Latin "a" U+0061 vs Cyrillic "а" U+0430). An attacker can register a Unicode look-alike of a real domain. Modern browsers detect mixed-script labels and display the Punycode form to warn users.
Is the conversion lossless?
Yes. Every well-formed IDN label round-trips perfectly between Unicode and Punycode by design.