Punycode Converter
Developer Tools · By Sidhin · Added
DNS carries only letters, digits and hyphens, so a domain written in any other script travels as punycode with an xn-- prefix. Browsers show you one form and everything underneath shows the other, which is why the two are worth comparing rather than trusting.
How to use the punycode converter
- 1Paste a domain in either form — Unicode or xn--.
- 2Read both forms; each has its own copy button.
- 3Check the label table, which shows the length of each encoded label against the DNS limit.
- 4Look at the scripts column if the domain came from an email or a message rather than from you.
Examples
A German domain
- Input
- münchen.de
- Result
- xn--mnchen-3ya.de
A substituted character
- Input
- аpple.com, with a Cyrillic first letter
- Result
- xn--pple-43d.com — flagged as mixing writing systems
The two render identically; only the encoded form shows the difference.
About the punycode converter
How the encoding works
Punycode is an instance of a general algorithm called Bootstring, with parameters fixed for domain names: base 36, a bias that adapts as it goes, and a delimiter that separates the literal ASCII from the encoded remainder. The encoder walks the code points in ascending order, emitting the difference between each and the last as a variable-length number.
The adaptive bias is what makes it compact. A label whose non-ASCII characters are close together in Unicode — which is nearly every real word, since a language's letters sit in one block — encodes into very few digits, because each delta is small.
Where the two forms diverge in practice
A browser shows the Unicode form in the address bar, subject to its own rules about which scripts it will display — most refuse to render a mixed-script name and show the xn-- form instead, precisely because of the homograph problem.
Everything below the browser uses the encoded form: DNS records, TLS certificates, server logs, registrar invoices, email headers. When a certificate appears not to match a domain, or a log line does not match what was typed, this difference is usually why.
Frequently asked questions
What is the xn-- prefix for?
Why does the encoded form look nothing like the original?
What is a homograph attack?
Does this do the full IDNA processing?
Related tools
URL Encoder / Decoder
Developer Tools
Percent-encode and decode URLs and query parameters, with a query string breakdown.
Unicode Character Inspector
Text Tools
Break text down character by character — code point, bytes, escapes, and the invisible ones.
HTML Entity Encoder & Decoder
Developer Tools
Escape HTML characters to entities and decode them back, in named, decimal or hex form.
ASCII Table
Developer Tools
Searchable ASCII reference with decimal, hex, octal, binary and escapes.