IDN Punycode converter

5 of 2 ratings
IDN Punycode converter

IDN Punycode converter is a free tool that converts internationalised domain names to Punycode ASCII and converts Punycode back to readable Unicode text.

What is Punycode and why does it exist?

Punycode is part of the IDNA conversion from Unicode U-labels to ASCII A-labels. It allows names containing letters such as ü, é or 漢 to travel through systems originally designed for basic Latin letters, digits and hyphens.

An IDNA A-label starts with xn--. The prefix tells IDNA-aware applications that the remaining characters are a Punycode representation of a U-label. Dots remain separators, so each part of a domain is converted independently.

Punycode is used within Internationalised Domain Names in Applications, usually shortened to IDNA. IDNA also deals with validation and character handling, while Punycode provides the ASCII representation of an eligible Unicode label.

Punycode is encoding, not encryption. Anyone can convert the ASCII form back to Unicode, so it provides no secrecy and should never be used to conceal information.

Diagram showing text passing through the IDN Punycode converter in both directions

How do I convert an internationalised domain name?

Enter Unicode text in Convert to Punycode/ASCII, or enter ASCII A-labels in Convert to IDN/Text. The corresponding result appears in Punycode/ASCII or IDN/Text.

  1. Copy only the domain name or label you need to convert, without surrounding quotation marks.
  2. Use Convert to Punycode/ASCII for Unicode text containing accented or non-Latin characters.
  3. Use Convert to IDN/Text for ASCII A-labels.
  4. Check every converted label before placing it in DNS, email settings or application configuration.
The IDN Punycode converter tool on digily.link, showing its input form

The converter uses the PHP idn_to_ascii and idn_to_utf8 functions. Processing takes place on the server. Your input travels to the server over HTTPS and is not stored.

Worked domain examples

A small conversion shows the relationship between the displayed name and its DNS-compatible form.

Input münchen.de

Output xn--mnchen-3ya.de

Converting the output in the other direction returns münchen.de. The ASCII-only label de does not need conversion, while the label containing ü becomes an xn-- label.

Input needs to be valid domain-name text. The underlying format handles common cases as follows:

  • Accented and non-Latin letters: eligible Unicode labels are represented in ASCII through IDNA and Punycode.
  • Dots: each dot separates labels. A domain can therefore contain a mixture of ordinary ASCII labels and encoded labels.
  • Numbers and ordinary hyphens: these are already ASCII and generally remain readable, subject to domain-name syntax rules.
  • Spaces: spaces are not valid inside ordinary DNS host labels. Remove an accidental space rather than expecting Punycode to preserve it as part of the domain.
  • Punctuation: a full stop separates labels, but characters belonging to a URL path, port or query string are not part of the hostname.
  • Empty or very long input: an empty value has no domain to convert. DNS also limits each encoded label to 63 octets, so a visually short Unicode label can become too long after conversion.
Example result produced by the IDN Punycode converter tool

Why does Punycode conversion fail or produce unexpected text?

Conversion usually fails because the input is not valid IDN text, contains a malformed A-label, or has been passed through another encoding first. When converting to IDN/Text, ordinary ASCII input that is not an A-label may simply remain unchanged. Check whether the source contains Unicode U-labels, ASCII A-labels or a URL-encoded hostname before changing characters by hand.

  • Malformed A-labels or the wrong encoding: a malformed xn-- label can fail conversion. Base64, hexadecimal text and percent-encoded URLs are not Punycode.
  • Unsupported characters: Punycode can represent Unicode values, but IDNA rules and domain registries can reject particular characters, combinations or scripts.
  • Excess label length: DNS limits each encoded label to 63 octets, so a Unicode label can become too long after conversion.
  • Partial input: copying brackets, a port number or part of an HTML attribute with the hostname can make the value invalid.
  • Double-encoded input: if characters in a Punycode domain were explicitly or non-canonically percent-encoded, they may appear as percent sequences. Decode that URL layer first with a URL decoder, then convert the resulting domain.
  • Binary rather than text data: IDN conversion works with Unicode domain-name text. Arbitrary file bytes can fail validation or produce meaningless characters when treated as text.

Where will I encounter Punycode?

You will mainly encounter Punycode in domain names, DNS records, browser address handling and systems that store hostnames as ASCII. A browser may display the readable internationalised name or retain the xn-- form, depending on its safety rules and the characters involved.

Email addresses can use Punycode in the domain after the @ sign. It does not encode the mailbox name before the @ sign. JSON payloads and query strings may contain Punycode when they carry a hostname, but JSON and query-string syntax do not require Punycode for general text.

Data URIs normally use percent encoding or Base64 for their content. Punycode appears there only if the contained text happens to include an internationalised hostname. Similarly, use a URL encoder for path or query values and Punycode for the hostname itself.

Frequently asked questions

Can I paste a complete URL into an IDN converter?

It is safer to extract the hostname and convert that part alone. The scheme, port, path, fragment and query have separate syntax rules, and characters in those sections may need URL encoding rather than Punycode.

Does a domain name containing an xn-- label mean a website is unsafe?

No. Many legitimate internationalised domains use xn-- labels. However, visually similar characters from different writing systems can be used in misleading names, so check the decoded spelling and the expected organisation before entering passwords or payment details.

Can emoji be used in a Punycode domain?

Emoji are disallowed in IDNA domain labels, even though the Punycode algorithm can encode their code points. Domain registry policies can impose further restrictions on permitted scripts and symbols.

Why does my browser show Punycode instead of Unicode?

Browsers may keep the ASCII form when a label mixes scripts, contains characters associated with spoofing, or does not meet their display policy. This is a display safeguard rather than evidence that the conversion is incorrect.

Will a converted name definitely work in DNS?

No. Successful conversion does not prove that the domain is registered, available or permitted by the relevant registry. Before using the result, verify the label length, check the readable spelling and confirm the registry accepts the characters involved.

Popular Tools