Punycode Converter

Turn an international domain into ASCII punycode, or turn xn-- labels back into letters.

International names and the ASCII form DNS stores

DNS labels are ASCII. A name such as münchen or 中文 is stored as a punycode label that starts with xn--. This page converts those labels. It is not a URL encoder: slashes, the query and the hash stay as you typed them. To split a finished address, use URL parser.

How to use it

  1. Paste a domain, a full URL, or an email address.
  2. Choose “To punycode (ASCII)” or “To Unicode”. The example is https://münchen.example/path going to ASCII.
  3. Only the host is converted in a URL. In an email, only the domain after @ is converted. The path, including Chinese characters in it, is left alone.
  4. A bad xn-- label shows an error instead of a half-decoded name.

What changes and what does not

Each dot-separated label is converted on its own. ASCII labels such as example stay ASCII. münchen.de becomes xn--mnchen-3ya.de. 中文.com becomes xn--fiq228c.com. The scheme, the path and the query are not punycode. Applying the opposite direction brings the letters back. This is the IDNA encoding used in hostnames, not a general text cipher.

Where people use it

  • Reading an xn-- name from a certificate or a DNS export.
  • Putting a Chinese or German domain into a system that only accepts ASCII hosts.
  • Checking that a pasted IDN is the name you think it is, before you trust it.

Questions

Why is the path still in Chinese?

Punycode applies to DNS labels, not to the path. A path is encoded with percent-encoding if the next system requires it.

I pasted an email and the name in front of @ did not change.

That is the local part. Only the domain is a hostname.