Punycode Converter
Convert internationalized domain names (IDN) to Punycode and vice versa.
Updated
What is the Punycode Converter?
Welcome to the Punycode Converter, your essential tool for managing internationalized domain names (IDNs). In today's globalized digital landscape, domain names often include characters from various languages and scripts, such as Arabic, Chinese, Cyrillic, or Latin characters with diacritics (like ü, é, ñ). While these characters make the internet more accessible worldwide, the underlying Domain Name System (DNS) primarily operates using a limited set of ASCII characters.
Punycode acts as a bridge, providing a standardized way to represent these diverse Unicode domain names using only the ASCII characters supported by the DNS. This conversion is crucial for ensuring that international domain names can be registered, resolved, and accessed across the internet seamlessly.
Our Punycode Converter simplifies this complex process, allowing you to effortlessly convert Unicode domain names into their Punycode (ASCII-compatible) equivalents and vice versa. Whether you're a web developer, a domain registrar, or simply someone dealing with international domains, this tool provides a fast, accurate, and user-friendly solution for all your Punycode conversion needs. It supports both single conversions and batch processing, making it ideal for handling multiple domains or URLs efficiently.
How it works
The Punycode Converter facilitates the translation between human-readable Unicode domain names and their ASCII-compatible Punycode representations. This process is essential for Internationalized Domain Names (IDNs) to function within the existing Domain Name System (DNS), which was originally designed to handle only a limited set of ASCII characters.
The Core Mechanism: Punycode Encoding and Decoding
At its heart, the tool implements the Punycode algorithm, as defined by RFC 3492 1. This algorithm provides a robust and standardized method for converting strings of Unicode characters into a sequence of ASCII characters, prefixed with xn-- to signify a Punycode-encoded label. The reverse process, decoding, reconstructs the original Unicode string from its Punycode form.
Encoding (Unicode to Punycode)
When you input a Unicode domain name (e.g., müller.com), the tool performs the following steps:
Identification of Non-ASCII Characters: The tool first identifies any parts of the domain name that contain non-ASCII characters (e.g.,
müller). ASCII-only parts (e.g.,.com) remain unchanged.Punycode Algorithm Application: For each label containing non-ASCII characters, the Punycode encoding algorithm is applied. This algorithm essentially represents the non-ASCII characters as a sequence of ASCII characters, along with a delimiter and a special prefix (
xn--). For instance,müllerbecomesxn--mller-kva.Reassembly: The converted Punycode labels are then reassembled with the original ASCII labels and domain separators to form the complete Punycode domain name (e.g.,
xn--mller-kva.com).
Decoding (Punycode to Unicode)
Conversely, when you input a Punycode domain name (e.g., xn--mller-kva.com), the tool:
Detection of Punycode Prefix: It identifies labels prefixed with
xn--, indicating they are Punycode-encoded.Punycode Algorithm Application: For each identified Punycode label, the decoding algorithm reverses the encoding process, reconstructing the original Unicode characters.
Reassembly: The decoded Unicode labels are then combined with any ASCII-only parts to form the original Unicode domain name (e.g.,
müller.com).
Advanced Features
Smart URL and Email Handling
Our converter goes beyond simple domain name conversion. It intelligently processes full URLs and email addresses:
URLs: If you input a URL (e.g.,
https://müller.com/path/to/page), the tool extracts only the hostname (müller.com), converts it, and then reconstructs the full URL with the Punycode hostname (e.g.,https://xn--mller-kva.com/path/to/page), leaving the protocol and path untouched.Email Addresses: Similarly, for email addresses (e.g.,
user@müller.com), only the domain part (müller.com) is converted to Punycode, preserving the local part (user@).
Batch Processing
For users needing to convert multiple entries, the tool supports batch processing. You can input several domain names, URLs, or email addresses, each on a new line. The converter will process each line independently and return the corresponding converted output, maintaining the line-by-line structure.
Real-time Statistics
To provide immediate feedback and insights, the tool displays real-time statistics, including the input and output character lengths, the difference in length, and whether the output is longer or shorter than the input. This helps users understand the impact of Punycode encoding on string length.
References
Examples
Convert Unicode domain to Punycode
Convert a domain name with special characters to its Punycode equivalent.
Convert Punycode domain to Unicode
Decode a Punycode domain back to its original Unicode form.
Convert a URL with Unicode characters
Encode a full URL containing internationalized characters.
Convert an email address with Unicode characters
Encode the domain part of an email address with special characters.
Batch conversion of multiple domains
Convert several Unicode domains at once, each on a new line.
Frequently asked questions
What is Punycode?
What is Punycode?
Punycode is a special encoding syntax that converts Unicode characters into a limited ASCII character set. It was developed to allow Internationalized Domain Names (IDNs), which contain characters outside the basic Latin alphabet, to be represented within the Domain Name System (DNS), which only supports ASCII characters. This ensures global compatibility for domain names.
Why is Punycode necessary?
Why is Punycode necessary?
Punycode is necessary because the Domain Name System (DNS) was originally designed to use only a subset of ASCII characters (A-Z, 0-9, and hyphens). Without Punycode, domain names containing characters from other languages (like é, ü, ñ, or characters from Cyrillic, Arabic, or Chinese scripts) would not be resolvable on the internet. Punycode provides a standardized way to represent these international characters in an ASCII-compatible format, making IDNs universally accessible.
How do I identify a Punycode domain?
How do I identify a Punycode domain?
Punycode domains are easily identifiable by the prefix xn--. Any domain label that starts with xn-- indicates that it is an encoded Punycode string. For example, müller.com in Unicode becomes xn--mller-kva.com in Punycode.
Can Punycode be used for URLs and email addresses?
Can Punycode be used for URLs and email addresses?
Yes, Punycode is primarily used for the domain name portion of URLs and email addresses. Our tool is designed to intelligently detect and convert only the hostname part of a URL or the domain part of an email address, leaving other components like protocols, paths, or local email parts unchanged. For example, https://müller.com/path converts to https://xn--mller-kva.com/path, and user@müller.com converts to user@xn--mller-kva.com.
Is Punycode secure? Can it be used for phishing?
Is Punycode secure? Can it be used for phishing?
Punycode itself is a standard encoding mechanism and is not inherently insecure. However, it can be exploited in phishing attacks, known as homograph attacks. Attackers might register domain names that look visually similar to legitimate ones by using Unicode characters (e.g., apple.com vs. аррle.com where some Latin characters are replaced with visually similar Cyrillic ones ). When converted to Punycode, these might appear as xn--pple-4gg.com, which is harder for users to spot as malicious. Modern browsers and email clients have implemented measures to detect and warn users about such deceptive Punycode domains.
What is the difference between Punycode and IDN?
What is the difference between Punycode and IDN?
IDN (Internationalized Domain Name) refers to a domain name that contains at least one character not from the basic ASCII character set. These are the human-readable domain names in various languages. Punycode is the encoding mechanism used to convert these IDNs into an ASCII-compatible format that the DNS can process. So, an IDN is the concept of a multilingual domain name, and Punycode is the technical standard that makes IDNs work on the internet.
Related tools
More utilities you might find handy.
Base32 Encoder Decoder
Encode text or hex to Base32 (RFC 4648) and decode Base32 strings back to UTF-8 instantly in your browser.
Quoted-Printable Encoder
Encode and decode MIME quoted-printable text in your browser.
URL Safe Base64 Encoder / Decoder
Encode and decode Base64 using the URL-safe alphabet (RFC 4648 §5) — replaces + with - and / with _ so output is safe in URLs, filenames, and JWTs without percent-encoding.