What is punycode? How international domain names work
Web addresses can contain accented letters, Chinese characters, Arabic script and more, yet the system underneath only understands a small set of plain characters. Punycode is the translation layer that makes both sides work.
The problem punycode solves
The Domain Name System was designed around letters A to Z, digits and hyphens. When people wanted domain names in their own languages, the system could not simply be rebuilt, because every resolver, registrar and mail server already relied on those limits.
The answer was Internationalized Domain Names in Applications (IDNA). Your browser converts a readable name into an ASCII-only form before it asks the DNS about it. The encoding used for that conversion is called punycode.
What a punycode name looks like
Any label that contains a non-ASCII character is encoded and given the prefix xn--. Labels that are already plain ASCII are left alone. Here are a few real conversions:
bücher.example -> xn--bcher-kva.example
münchen.de -> xn--mnchen-3ya.de
mañana.es -> xn--maana-pta.es
日本語.jp -> xn--wgv71a119e.jpHow the encoding works, in short
Punycode first copies every plain ASCII character in the label in its original order. Then it adds a hyphen, followed by a compact series of numbers that records which special characters were inserted and at which positions.
That is why xn--bcher-kva still shows bcher, which is bücher without the u with two dots, followed by -kva, which carries the missing character and its position. The scheme is reversible, so any punycode label can be turned back into exactly the original text.
Where you will meet it
- In DNS records, where registrars and hosting panels often need the xn-- form.
- In SSL certificates, which list international names in punycode.
- In server logs, firewall rules and email headers, which show the encoded form.
- In your browser address bar, which shows the readable version in most cases.
Look-alike domains and why punycode helps you spot them
Different alphabets contain letters that look almost identical. The Cyrillic letter а looks just like the Latin letter a. A domain written with the Cyrillic letter in place of the Latin one can look the same as the real brand, but its punycode form is completely different.
For example, the name аpple.com, written with a Cyrillic first letter, converts to xn--pple-43d.com. It is not the same domain as the ordinary Latin spelling.
Browsers defend against this by showing the xn-- form when a name mixes scripts in suspicious ways. If a link looks right but you are unsure, paste the domain into a converter and check whether it turns into an xn-- address.
Rules and limits to know
- Each label can be up to 63 characters long in its encoded ASCII form, and the whole name up to 253 characters.
- Domain names are not case sensitive, so capital letters are lower-cased before encoding.
- Only the domain name is encoded. The path and query of a URL use a different system called percent-encoding.
- Some top-level domains allow only certain scripts, so not every international name can be registered.
Convert a domain in seconds
The Toolstia punycode converter works both ways. Paste one or more domains, one per line, and it converts each label on its own. It runs in your browser, so the names you enter are not sent anywhere.
To pull a full link apart first, use the URL parser, then paste just the host part into the converter.