Punycode Converter

Convert international domain names to Punycode (ASCII) and back. Supports full URLs and domain names.

  1. Home
  2. > Encoder & Decoder >
  3. Punycode Converter

Encode to Punycode

Decode from Punycode

What is Punycode?

Punycode is a special encoding system defined in RFC 3492 that converts Unicode (international) characters into the limited ASCII character set allowed for domain names. It is the foundation of Internationalized Domain Names (IDN), enabling domain names with non-ASCII characters like münchen.de, café.fr, or δοκιμή.gr.

Punycode-encoded domains are prefixed with xn--. For example, münchen.de becomes xn--mnchen-3ya.de. The xn-- prefix tells browsers and DNS systems that the label uses Punycode encoding.

Why Punycode Matters

  • Enables domain names in native scripts (Arabic, Chinese, Cyrillic, etc.)
  • Critical for DNS compatibility — DNS only understands ASCII
  • Prevents homograph attacks by revealing actual encoded domain
  • Required by all modern browsers for IDN support

How to Use This Punycode Converter

  1. Encode to Punycode — Type or paste a Unicode domain name or URL in the left panel (e.g., münchen.de), then click Encode.
  2. Decode from Punycode — Type or paste a Punycode domain in the right panel (e.g., xn--mnchen-3ya.de), then click Decode.
  3. Supports full URLs — You can paste complete URLs like https://münchen.de/path?q=1 and only the domain portion will be encoded.
  4. Swap & Clear — Click Swap to exchange encode/decode values, Clear All to reset everything.

Common Use Cases

  • Domain registration — Check how your international domain name looks in Punycode before registering it.
  • Security auditing — Decode Punycode domains to detect homograph attacks where lookalike characters are used to impersonate legitimate domains.
  • DNS configuration — Convert Unicode domain names to Punycode for DNS zone files and web server configuration.
  • Email client setup — Configure email clients with international domain names by converting them to Punycode.
  • Browser testing — Verify that your web application correctly handles IDN domain names in URLs and redirects.

Frequently Asked Questions

What does the xn-- prefix mean?

The xn-- prefix is an ASCII Compatible Encoding (ACE) prefix defined by IDNA (Internationalized Domain Names in Applications). It signals to DNS resolvers and browsers that the following characters are a Punycode-encoded international domain label.

Can all Unicode characters be used in domain names?

No. IDNA only allows certain Unicode characters. Some characters are excluded for security reasons (e.g., lookalike characters that could be used in homograph attacks). Each top-level domain registry may also have its own restrictions on which scripts and characters are permitted.

What is a homograph attack?

A homograph attack uses characters that look identical but have different Unicode code points. For example, the Cyrillic letter "а" (U+0430) looks identical to the ASCII "a" (U+0061). Punycode reveals the actual encoding, making it possible to detect such attacks.

Does this tool work with full URLs?

Yes. If you paste a full URL (e.g., https://münchen.de/path?q=1), the tool extracts the hostname, converts only the domain portion, and preserves the protocol and path in the output.

Is Punycode the same as IDN?

Punycode is the encoding mechanism. IDN (Internationalized Domain Name) is the overall system that uses Punycode to represent non-ASCII domain names in the DNS. All modern browsers and operating systems support IDN with transparent Punycode conversion.

Help2Code Logo
Menu