WebTools

307 Useful Tools & Utilities to make life easier.

Unicode to Punycode

Convert Unicode to Punycode.

Introduction to the Unicode to Punycode Converter

The Domain Name System (DNS) was originally engineered in the 1980s under strict technical constraints. To maintain global compatibility and stability across early computer networks, the original RFC standards (including RFC 1034 and RFC 1035) restricted hostnames to the basic ASCII character repertoire: unaccented Latin letters (A–Z), Arabic numerals (0–9), and hyphens. As the internet expanded into a global network utilized by diverse cultures and languages, this limitation presented a major barrier for speakers of languages that rely on accents, non-Latin alphabets (such as Cyrillic, Greek, Arabic, and Hebrew), Asian writing systems (such as Chinese logograms, Japanese Kanji/Kana, and Korean Hangul), and modern symbols.

To enable Internationalized Domain Names (IDNs) without breaking legacy DNS infrastructure or requiring a disruptive worldwide overhaul of network equipment, the Internet Engineering Task Force (IETF) standardized Punycode in RFC 3492. Punycode is an efficient encoding algorithm based on the Bootstring specification. It uniquely and reversibly transforms arbitrary strings of Unicode characters into standard ASCII character sequences.

The Unicode to Punycode Converter provides a fast, reliable, and accessible interface for converting any text containing Unicode characters into its compact Punycode representation. Built with an intuitive Alpine.js frontend powered by the industry-standard punycode.js library, this tool executes all calculations entirely in your web browser. Because the encoding process runs locally on your client machine, your inputs are never sent over the network to external servers, providing zero latency and complete privacy for your sensitive domain research, web development, and internationalization workflows.

Practical Worked Examples

The Punycode algorithm works through a two-step process: first, it extracts all standard ASCII characters from the input text and places them at the front. Second, it calculates a mathematical delta encoding of the non-ASCII Unicode characters and their positional insertions, appending this encoded data after a delimiter hyphen (-). Below are practical examples illustrating how Unicode strings are converted into Punycode:

Example 1: Accented Latin Characters (German City Name)

  • Input (Unicode): münchen
  • Output (Punycode): mnchen-3ya

In this example, the basic ASCII letters (mnchen) are preserved at the beginning of the output string. The hyphen (-) serves as a delimiter, followed by the encoded suffix 3ya, which mathematically instructs decoders where to insert the umlaut character ü (Unicode code point U+00FC).

Example 2: Words with Diacritics (French Cafe)

  • Input (Unicode): café
  • Output (Punycode): caf-bfa

Here, the basic letters caf are placed at the start, followed by the delimiter and the encoded indicator bfa, which specifies the insertion of the accented é at the fourth character position.

Example 3: Non-Latin Scripts (Japanese Romanized Macron)

  • Input (Unicode): tōkyō
  • Output (Punycode): tky-2oa7c

The letters with macrons (ō) are removed from the basic string, leaving tky, and the delta instruction 2oa7c encodes both occurrences of the macron character.

Example 4: Emoji Strings

  • Input (Unicode): i❤
  • Output (Punycode): i-7iq

Since emojis are standardized Unicode code points (U+2764 for the heavy black heart), the tool retains the standard letter i and encodes the heart symbol as 7iq.

Applying Punycode to Internationalized Domain Names (IDNs)

When registering or configuring an IDN with a domain registrar or in DNS zone records, web protocols prepend the ASCII Compatible Encoding (ACE) prefix xn-- to the Punycode label. For instance, the domain label münchen.com is registered and resolved in DNS as xn--mnchen-3ya.com.

Frequently Asked Questions (FAQ)

What is the difference between raw Punycode and the "xn--" prefix?
Raw Punycode is the encoded character string produced by the RFC 3492 algorithm (e.g., mnchen-3ya). The xn-- prefix is the standard ASCII Compatible Encoding (ACE) prefix defined in IDNA standards. DNS systems and web browsers attach xn-- to the beginning of a Punycode label (e.g., xn--mnchen-3ya) to indicate to software that the label is an encoded Internationalized Domain Name rather than a plain ASCII word.
Why does DNS use Punycode instead of UTF-8?
The global Domain Name System was established long before Unicode became standard. Thousands of legacy routers, name servers, mail transfer agents, and protocols were hard-coded to accept only ASCII characters. Punycode allows non-ASCII domain names to function seamlessly across the existing internet architecture without requiring every legacy server in the world to be upgraded simultaneously.
Is Punycode encoding reversible and lossless?
Yes, Punycode is completely lossless and bidirectional. Any valid Unicode string can be converted into Punycode, and that Punycode output can be decoded back into the exact original Unicode string without any loss of data or character distortion.
Does this tool send my data to a remote server?
No. The conversion process is performed entirely on your device using client-side JavaScript. None of the text or domain strings you enter are transmitted to our servers, stored in databases, or tracked, ensuring complete privacy.
Can I convert complete URLs or email addresses?
This tool is designed to encode individual text strings or domain labels into Punycode. For domain names with multiple labels (such as subdomains), each non-ASCII segment between the dots is encoded individually. Note that the path, query parameters, and fragments of a URL typically use standard URL percent-encoding (such as %20 for spaces) rather than Punycode.
Does the converter support all Unicode scripts and emojis?
Yes. Punycode supports the full range of Unicode code points, including Latin diacritics, Cyrillic, Arabic, Chinese, Devanagari, Japanese, Korean, mathematical symbols, and emojis.

Contact

Missing something?

Feel free to request missing tools or give some feedback using our contact form.

Contact Us