Format Code Now
/

Punny Code Converter

ED-47

Punny code is a common typo for Punycode, the encoding behind xn-- domain names. Paste names one per line and click Convert to Punycode, or Convert to text to go back.

Runs in your browser. Nothing is uploaded.

Domain names or text, one per line

Result

How to use it

  1. Paste domain names or text, one per line.
  2. Click Convert to Punycode to get names such as xn--bcher-kva.example.
  3. Click Convert to text to turn xn-- labels back into characters.
  4. Use Raw Punycode encode or decode to convert a whole line with no dots and no xn-- prefix.

What Punycode is

DNS only allows letters, digits and hyphens, so a name such as bücher.example cannot be stored as is. Punycode, defined in RFC 3492, turns the non-ASCII characters of a label into those allowed characters. A label that needed encoding gets the prefix xn--, so bücher becomes xn--bcher-kva. This tool splits each line at dots and lowercases it, then encodes the labels that need it.

Limits of this converter

It does the Punycode step only. It is not the full IDNA or UTS 46 processing that browsers and registries apply, so it does not map look-alike or full-width characters, normalize text, apply registry character rules or check the 63 character label limit. Paste host names, not full URLs. The raw actions work on whole lines and skip the dot splitting and the xn-- prefix.

Error messages and what to do

MessageWhat it meansFix
so it is not a bare host nameA line contains a space, slash or other character that does not belong in a host name.Paste only the domain, such as bücher.example.
Invalid Punycode characterThe part after the last hyphen has a character other than a to z and 0 to 9.Check the string for a typo or a stray character.

Questions people ask

What is a punny code converter?

It is usually someone looking for a Punycode converter. Punycode is the standard way to write international domain names with plain ASCII characters, and this page converts to and from it. The name punny code is a frequent misspelling.

How do I convert a domain to Punycode?

Paste the domain and click Convert to Punycode. Each label with non-ASCII characters is encoded and given the xn-- prefix, and plain ASCII labels are only lowercased. For example, münchen.de becomes xn--mnchen-3ya.de.

How do I decode an xn-- domain?

Paste the name and click Convert to text. Labels that start with xn-- are decoded to their Unicode characters, and other labels are left alone. So xn--bcher-kva.example becomes bücher.example.

What do the raw Punycode actions do?

They encode or decode each whole line as one string, without splitting at dots and without the xn-- prefix. So bücher gives bcher-kva. Use them when you need the bare RFC 3492 output rather than a domain name.

Is this the same as IDN conversion in a browser?

Not entirely. Browsers apply extra IDNA rules such as character mapping and security checks that this tool does not. It gives the Punycode for the characters you typed. For a real domain registration, rely on your registrar's own checks.

About this tool

The name is a common misspelling of Punycode, the encoding from RFC 3492 that writes international domain names with the letters, digits and hyphens that DNS allows. Convert to Punycode splits each line at dots, lowercases it, and writes every label that contains non-ASCII characters as xn-- plus its Punycode. Convert to text reverses that. The raw actions encode or decode each whole line with no dot splitting and no xn-- prefix. This is not the full IDNA or UTS 46 processing that browsers and registries apply: no look-alike mapping, no normalization, no registry character rules, and no 63 character label check. Nothing is uploaded.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.