Punycode Converter — Free Online Tool

Encode/decode punycode for internationalized domain names (IDN). Convert Unicode domains (café.com) to ASCII (xn--caf-dma.com). Supports emoji domains.

Use this free online Punycode Converter directly in your browser. No signup required, no data leaves your device. Part of Utilier — a collection of 133+ developer utilities.

What is Punycode Encoder & Decoder (IDN Converter)?

Punycode is an encoding system that converts Unicode characters (café, münchen, 日本) to ASCII-compatible format for domain names (DNS). Since DNS only supports ASCII (a-z, 0-9, hyphen), Punycode encodes internationalized domains using 'xn--' prefix: café.com → xn--caf-dma.com, münchen.de → xn--mnchen-3ya.de, 日本.jp → xn--wgv71a.jp. This tool encodes Unicode to Punycode (IDN to ASCII) and decodes Punycode back to Unicode (ASCII to IDN). Useful for registering international domains, debugging email addresses with Unicode, or converting emoji domains (😀.com → xn--e28h.com).

  • Encode Unicode to Punycode: Convert café.com → xn--caf-dma.com, münchen.de → xn--mnchen-3ya.de, 日本.jp → xn--wgv71a.jp. Prefixes with 'xn--' (IDN prefix). Supports all Unicode: accents (é, ö), CJK (中文, 日本語), emoji (😀, 🎉).
  • Decode Punycode to Unicode: Convert xn--caf-dma.com → café.com, xn--mnchen-3ya.de → münchen.de, xn--wgv71a.jp → 日本.jp. Removes 'xn--' prefix and decodes ASCII.
  • Email address support: Encode/decode email addresses: café@example.com → café@example.com (local part unchanged), test@café.com → test@xn--caf-dma.com (domain encoded). Only domain part is Punycoded.
  • Emoji domains: Encode emoji domains: 😀.com → xn--e28h.com, 🎉🎂.party → xn--uj8haa.party. Emoji are Unicode, so they're Punycode-encoded.
  • IDN validation: Checks if domain is valid IDN (Internationalized Domain Name). Validates Punycode syntax, Unicode normalization (NFC), and restricted characters.

Why use punycode?

DNS only supports ASCII characters, but modern domains can use Unicode (accents, CJK, emoji). Punycode bridges this gap by encoding Unicode as ASCII.

  • Register international domains: Register domains with accents (café.com), non-Latin characters (日本.jp, кремль.ru), or emoji (😀.com). Must convert to Punycode for DNS.
  • Debug email addresses: Email with Unicode domains (test@café.com) may fail in some systems. Encode to ASCII (test@xn--caf-dma.com) for compatibility.
  • Understand IDN homograph attacks: Attackers register domains that look similar: аррӏе.com (Cyrillic а, р, ӏ) vs apple.com (Latin a, p, l). Punycode reveals difference: xn--80ak6aa92e.com vs apple.com.
  • SEO and internationalization: Use Unicode domains for local markets (café.com for France, 日本.jp for Japan). Improves brand recognition and SEO in local search.
  • Test domain availability: Check if Unicode domain is available by converting to Punycode and querying domain registrar (e.g., café.com → xn--caf-dma.com → check availability).
  • Learn encoding systems: Understand how Punycode works: Bootstring algorithm, base-36 encoding, delimiter (hyphen). Great for learning encoding/compression techniques.

When to use punycode

Use whenever you work with internationalized domain names or Unicode in URLs.

  • Registering domains with Unicode characters (café.com, münchen.de, 日本.jp, 😀.com).
  • Debugging email addresses with Unicode domains (test@café.com vs test@xn--caf-dma.com).
  • Detecting IDN homograph attacks (Cyrillic аррӏе.com vs Latin apple.com).
  • Converting URLs for DNS lookups or HTTP requests (browsers auto-convert, but APIs may need Punycode).
  • Testing internationalized domain names in development (local testing, API calls).
  • Understanding how Unicode domains work in DNS, email, and browsers.
  • Verifying Punycode encoding is correct (compare encoded output with expected result).

How to use punycode

Enter Unicode or Punycode, click Encode/Decode.

  1. Select Encode or Decode: Encode = Unicode → Punycode (café.com → xn--caf-dma.com). Decode = Punycode → Unicode (xn--caf-dma.com → café.com).
  2. Enter text: Enter domain (café.com, münchen.de, 日本.jp), email (test@café.com), or emoji (😀.com). Or Punycode (xn--caf-dma.com) for decoding.
  3. Click Encode/Decode: Tool converts text. Encoding adds 'xn--' prefix. Decoding removes 'xn--' and converts ASCII to Unicode.
  4. View result: See Punycode output (xn--caf-dma.com) or Unicode output (café.com). Copy to clipboard for use.
  5. Validate IDN (optional): Check if domain is valid IDN: Unicode normalization (NFC), no restricted characters (e.g., no emoji in .com until 2017), valid Punycode syntax.
  6. Test in browser or API: Paste Punycode into browser (http://xn--caf-dma.com). Browser may show Unicode in address bar (café.com). For APIs, use Punycode (DNS only supports ASCII).
  7. Compare with expected: If encoding/decoding gives unexpected result, check Unicode normalization (é = U+00E9 vs e + ́ = U+0065 + U+0301). Punycode requires NFC normalization.

Key features

  • Encode Unicode to Punycode: Convert café.com → xn--caf-dma.com. Supports accents, CJK, emoji, all Unicode characters.
  • Decode Punycode to Unicode: Convert xn--caf-dma.com → café.com. Removes 'xn--' prefix and decodes ASCII.
  • Email address support: Encode/decode email domains: test@café.com → test@xn--caf-dma.com. Local part unchanged.
  • Emoji domains: Encode emoji: 😀.com → xn--e28h.com. Emoji are Unicode, so they're Punycoded.
  • IDN validation: Validates Punycode syntax, Unicode normalization (NFC), restricted characters.
  • Homograph detection: Reveals lookalike domains: аррӏе.com (Cyrillic) → xn--80ak6aa92e.com vs apple.com (Latin).
  • Bulk conversion: Convert multiple domains at once (one per line). Useful for lists or batch processing.

Common use cases

  • Register café.com: café.com → xn--caf-dma.com. Register with domain registrar using Punycode. Browsers display as café.com (Unicode), DNS uses xn--caf-dma.com (ASCII).
  • Debug Unicode email: test@café.com may fail in legacy email systems (SMTP only supports ASCII). Encode to test@xn--caf-dma.com for compatibility. Modern email (SMTPUTF8) supports Unicode.
  • Detect homograph attack: аррӏе.com (Cyrillic а, р, ӏ) looks like apple.com (Latin a, p, l). Punycode reveals: xn--80ak6aa92e.com vs apple.com. Phishing risk.
  • Emoji domain: 😀.com → xn--e28h.com. Emoji domains are valid (since 2017 for some TLDs). Fun for marketing or short URLs.
  • Japanese domain: 日本.jp (Japan) → xn--wgv71a.jp. CJK domains popular in Asia. Improves local SEO and brand recognition.
  • German domain with umlaut: münchen.de (Munich) → xn--mnchen-3ya.de. Umlaut (ü) is common in German. Punycode makes it DNS-compatible.

Examples

Punycode encoding/decoding examples.

French domain with accent (café.com)

café.com (Unicode)
xn--caf-dma.com (Punycode)

é (U+00E9) encoded as 'dma'. 'caf' is ASCII (unchanged). Hyphen (-) separates ASCII from encoded part.

German domain with umlaut (münchen.de)

münchen.de (Unicode)
xn--mnchen-3ya.de (Punycode)

ü (U+00FC) encoded as '3ya'. 'mnchen' is ASCII (ü removed, then ü encoded separately). Common in German domains.

Japanese domain (日本.jp)

日本.jp (Unicode, means Japan)
xn--wgv71a.jp (Punycode)

日 (U+65E5) and 本 (U+672C) encoded as 'wgv71a'. No ASCII part, so no delimiter. CJK domains popular in Asia.

Emoji domain (😀.com)

😀.com (Unicode, emoji)
xn--e28h.com (Punycode)

😀 (U+1F600, grinning face) encoded as 'e28h'. Emoji domains valid in some TLDs (.com, .party) since 2017. Fun for marketing.

Email with Unicode domain (test@café.com)

test@café.com (Unicode email)
test@xn--caf-dma.com (Punycode email)

Only domain (café.com) encoded to xn--caf-dma.com. Local part (test) unchanged. SMTP may require ASCII, so use Punycode for compatibility.

Technical reference

Punycode encoding specification (RFC 3492):

Prefix
'xn--' indicates Punycode-encoded domain (Internationalized Domain Name, IDN). Example: café.com → xn--caf-dma.com. Only applies to non-ASCII characters.
Encoding algorithm
Bootstring algorithm with base-36 encoding (a-z, 0-9). Encodes Unicode code points (U+00E9 for é) as ASCII. Optimized for short output (compression).
Delimiter
Hyphen (-) separates ASCII characters from encoded part. Example: café → caf-dma (caf = ASCII, dma = encoded é). If no ASCII, no delimiter.
Unicode normalization
Punycode requires NFC normalization (Normalization Form C). Example: é = U+00E9 (NFC) vs e + ́ = U+0065 + U+0301 (NFD). Must normalize before encoding.
Case-insensitive
Punycode is case-insensitive (xn--caf-dma.com = xn--CAF-DMA.COM). Browsers convert to lowercase. Email local part is case-sensitive (café@example.com ≠ CAFÉ@example.com).
Email addresses
Only domain part is Punycoded. Example: test@café.com → test@xn--caf-dma.com (test unchanged). Local part (before @) can use Unicode with SMTPUTF8.
Emoji encoding
Emoji are Unicode (😀 = U+1F600). Encoded as Punycode: 😀.com → xn--e28h.com. Supported by some TLDs (.com, .party) since 2017.
IDN homograph attack
Lookalike characters: Cyrillic а (U+0430) vs Latin a (U+0061). аррӏе.com (Cyrillic) → xn--80ak6aa92e.com. Phishing risk (looks like apple.com).
Browser behavior
Browsers display Unicode (café.com) in address bar but use Punycode (xn--caf-dma.com) for DNS. Some browsers show Punycode for mixed-script domains (anti-phishing).
DNS compatibility
DNS only supports ASCII (a-z, 0-9, hyphen). Punycode converts Unicode to ASCII for DNS lookups. IPv6 uses different encoding (not Punycode).

Common mistakes to avoid

Not normalizing Unicode (NFC vs NFD) before encoding, causing different Punycode

Why it happens: Unicode has multiple representations: é = U+00E9 (NFC, composed) vs e + ́ = U+0065 + U+0301 (NFD, decomposed). Punycode requires NFC normalization. Encoding NFD gives different result. Common when copying Unicode from different sources.

How to avoid it: Normalize to NFC before encoding: café.normalize('NFC'). JavaScript: String.prototype.normalize('NFC'). Python: unicodedata.normalize('NFC', text). Ensures consistent encoding.

Encoding entire email address (local + domain) instead of only domain

Why it happens: Email local part (before @) is NOT Punycoded. Only domain (after @) is encoded. Example: café@example.com → café@example.com (local unchanged), test@café.com → test@xn--caf-dma.com (domain encoded). Encoding local part breaks email.

How to avoid it: Split email by @. Encode only domain part. Example: local@domain → local + @ + punycode(domain). Don't encode local part unless using SMTPUTF8 (modern email).

Using Punycode for non-DNS contexts (URLs, filenames), breaking Unicode

Why it happens: Punycode is ONLY for DNS (domain names). Don't use for URL paths (/café/menu), query strings (?name=café), or filenames (café.txt). These support Unicode natively (UTF-8 encoding).

How to avoid it: Only encode domain name: https://café.com/menu → https://xn--caf-dma.com/menu (domain encoded, path unchanged). Or use percent-encoding for paths: /caf%C3%A9 (URL encoding, not Punycode).

Not detecting IDN homograph attacks (lookalike domains)

Why it happens: Cyrillic аррӏе.com (а = U+0430, р = U+0440, ӏ = U+04CF) looks identical to Latin apple.com (a = U+0061, p = U+0070, l = U+006C). Phishing risk. Users can't distinguish visually. Browsers sometimes show Punycode (xn--80ak6aa92e.com) as anti-phishing.

How to avoid it: Check Punycode: if domain looks suspicious (e.g., apple.com but Punycode is xn--...), it's likely homograph attack. Use IDN security checks (mixed scripts, confusables). Browsers warn for mixed scripts.

Assuming all TLDs support emoji domains

Why it happens: Emoji domains (😀.com) are valid in some TLDs (.com, .party, .ws) but NOT all. Some TLDs restrict Unicode (e.g., .gov, .edu). Registering emoji domain in unsupported TLD fails. Support started ~2017.

How to avoid it: Check TLD rules before registering emoji domain. Popular TLDs supporting emoji: .com, .net, .org, .party, .ws, .icu. Test with Punycode encoding (😀.com → xn--e28h.com).

Frequently asked questions

What is Punycode used for?

Punycode encodes Unicode characters (café, 日本, 😀) to ASCII for DNS (domain names). DNS only supports ASCII, so Punycode converts café.com → xn--caf-dma.com.

What does 'xn--' mean?

'xn--' is the prefix for Punycode-encoded domains (Internationalized Domain Names, IDN). Indicates domain contains non-ASCII characters. Example: xn--caf-dma.com = café.com.

Can I use emoji in domain names?

Yes, in some TLDs (.com, .party, .ws). Emoji are Unicode, so they're Punycode-encoded: 😀.com → xn--e28h.com. Support started ~2017. Fun for marketing.

How do I encode/decode Punycode in code?

JavaScript: Intl.toASCII(domain) / Intl.toUnicode(domain) or punycode.encode(domain) / punycode.decode(domain). Python: domain.encode('idna') / domain.encode('ascii').decode('idna'). Node: require('punycode').

What is an IDN homograph attack?

Lookalike domain using different script: Cyrillic аррӏе.com (Punycode: xn--80ak6aa92e.com) looks like Latin apple.com. Phishing risk. Browsers warn for mixed scripts.

Do I need to encode email addresses?

Only domain part (after @). Example: test@café.com → test@xn--caf-dma.com. Local part (before @) unchanged (unless SMTPUTF8 is used for Unicode local parts).

Why does my Punycode look different from expected?

Unicode normalization (NFC vs NFD). é = U+00E9 (NFC) vs e + ́ = U+0065 + U+0301 (NFD). Normalize to NFC before encoding: text.normalize('NFC').

References

Privacy and availability

  • Runs entirely in your browser — zero server processing
  • No signup or account required
  • Works offline once loaded
  • Fast, lightweight, no external dependencies
  • Available as a browser extension for Chrome and Firefox