Ttooleras
🌍

Punycode Converter

Encoding Tools

Encode internationalized domain names to Punycode and decode xn-- prefixed ASCII back to Unicode so non-Latin domains work in DNS, email, and the web.. Free, private — all processing in your browser.

Advertisement

The DNS only speaks ASCII. That was fine when every domain ended in .com, .org, or a country code and the letters in between came from the Latin alphabet. It stopped being fine the moment people wanted to register domains in Chinese, Arabic, Cyrillic, or with German umlauts. Punycode is the clever compromise: an algorithm that encodes Unicode labels into ASCII-compatible strings prefixed with xn-- so DNS infrastructure unchanged from 1983 can still route them.

This Punycode converter handles both directions. Paste münchen.de and get xn--mnchen-3ya.de, the form your registrar, DNS server, and SSL certificate provider actually need. Paste xn--nxasmq6b.example and read back its Unicode meaning. It works on full domain names (handling each label separately) and on standalone labels, and it decodes as well as encodes so you can verify what you are actually registering.

Punycode exists because IDN (internationalized domain names) are a fact of the modern web. Chinese, Russian, Indian, and Arabic-speaking markets register domains in their native scripts. Emoji domains exist for novelty and brand protection. But web servers, email systems, and certificate authorities all still transmit these as ASCII under the hood. Understanding Punycode prevents surprises when your monitoring, logging, or CSP configuration shows weird xn-- strings instead of the pretty domain you registered.

Punycode Converter — key features

Bidirectional conversion

Encode Unicode to Punycode and decode xn-- ASCII back to the original Unicode.

Multi-label handling

Handles full domain names by processing each label separately and only encoding non-ASCII labels.

Real-time validation

Flags invalid characters, oversized labels, and common mistakes before you copy.

Homograph detection

Highlights mixed scripts and confusable characters that may be blocked by registries or browsers.

Copy-ready output

One-click copy for both the Punycode form and its Unicode counterpart.

Email and URL awareness

Handles the local part, hostname, path, and query differently since only the host portion is encoded.

How to use the Punycode Converter

  1. 1

    Enter a domain or label

    Paste the Unicode form you want to encode, or the xn-- ASCII form you want to decode.

  2. 2

    Review the output

    The encoded and decoded forms appear side by side so you can confirm the round trip.

  3. 3

    Check the script warnings

    If the converter flags mixed scripts or confusables, consider whether registrars or browsers will accept or display the name.

  4. 4

    Copy the form you need

    Use the xn-- form for DNS records, WHOIS queries, and SSL certificates. Use the Unicode form for display and marketing materials.

  5. 5

    Verify with dig or whois

    Confirm the encoded domain resolves by running dig or your registrar lookup.

Common use cases for the Punycode Converter

Domain registration

  • :
  • :
  • :

Email and messaging

  • :
  • :
  • :

Security and compliance

  • :
  • :
  • :

Internationalization testing

  • :
  • :
  • :

Punycode Converter — examples

German umlaut

Converting münchen.de

Input
münchen.de
Output
xn--mnchen-3ya.de

French accent

Converting école.fr

Input
école.fr
Output
xn--cole-qma.fr

Cyrillic

Converting россия.рф

Input
россия.рф
Output
xn--h1alffa9f.xn--p1ai

Emoji label

A single-emoji domain

Input
🌮.ws
Output
xn--bj8h.ws

Decoding xn--

Decoding published Punycode

Input
xn--fsqu00a.xn--0zwm56d
Output
例子.测试

Technical details

Punycode is defined by RFC 3492 and used within IDNA specifications (RFC 5890-5894 for IDNA2008, superseding the older RFC 3490 IDNA2003). The algorithm is called Bootstring, and it works by separating a Unicode string into its ASCII characters (the "basic" code points) and its non-ASCII characters (the "extended" ones), then encoding insertion positions using a compact delta-encoded scheme.

Each label in a domain is encoded separately. The string münchen.de becomes two labels: münchen and de. Only labels containing non-ASCII characters get the xn-- prefix. Pure ASCII labels pass through unchanged. After encoding, münchen becomes xn--mnchen-3ya: the basic characters (mnchen) appear first, then a hyphen separator, then the Bootstring-encoded deltas for the ü insertion point (3ya).

IDNA2008 tightened character rules to prevent homograph attacks — domains that look visually identical using characters from different scripts. Registries now apply script-mixing restrictions and often disallow dangerous combinations. Browsers decide whether to display the Unicode form or the Punycode form based on TLD policy, the scripts used, and user preferences. Chrome and Firefox show Punycode (xn--) for domains mixing scripts that commonly enable phishing, but display Unicode for well-defined single-script domains in supported TLDs.

Common problems and solutions

Encoding the whole domain instead of labels

Each label must be encoded separately. Encoding the full string with dots as one unit produces invalid output.

Forgetting IDNA2008 validation

Some code points are disallowed for security. Punycode encoding alone does not guarantee the label is valid for registration.

Mixing scripts that trigger browser warnings

Combining Latin, Cyrillic, and Greek characters in one label may cause browsers to show xn-- instead of the pretty form.

Encoding the local part of an email

The part before @ is not Punycode. It uses SMTPUTF8 (RFC 6531) or its own encoding rules. Only the domain gets Punycode.

Label length over 63 characters

DNS labels have a hard 63-octet limit. Long Unicode strings may exceed this after encoding.

Assuming reversal is always identical

Some Unicode normalization steps (case folding, NFKC) mean the round trip may not produce exactly the input string.

Punycode Converter — comparisons and alternatives

Writing your own Punycode encoder is possible but production systems use a well-tested IDNA library because edge cases around normalization, bidi, and disallowed characters are subtle. Browser DevTools and WHOIS results show mixed Punycode and Unicode depending on policy, which makes debugging confusing without a dedicated converter. Command-line tools exist (idn, punycode in Node REPL) but require installation. This tool runs in the browser, handles full domains, flags homographs, and works offline after first load.

Frequently asked questions about the Punycode Converter

Why does my domain start with xn--?

That prefix signals a Punycode-encoded label. DNS uses the xn-- form; browsers display the Unicode form when safe.

Is Punycode secure?

The encoding is safe and reversible. Security issues come from homograph attacks where different Unicode characters look identical. Browsers mitigate this with display policies.

Do I need Punycode for subdomains?

Yes if the subdomain contains non-ASCII characters. Each label is encoded independently, so a domain can mix ASCII and Punycode labels.

Which TLDs support IDN?

Most generic TLDs support IDN, and many country TLDs have native-script variants. Check the registry policy for your TLD.

What about emojis?

Some TLDs allow emoji domains. They encode with Punycode like any other Unicode. Practical adoption is limited.

How do I use IDNs in code?

Most languages have IDNA libraries: idna in Python, punycode in Node, java.net.IDN in Java. Never implement the algorithm from scratch.

Do SSL certificates support IDN?

Yes. Certificates bind to the xn-- form. Browsers match correctly against the resolved domain.

Can I send email to an IDN address?

The domain part is Punycoded. For non-ASCII local parts you need an EAI (RFC 6531) capable mail server.

Additional resources

Advertisement

Related tools

All Encoding Tools

Learn more

Explore more tools

200+ free tools that run in your browser.

Browse all tools →