Punycode Converter

Convert Unicode to Punycode and Punycode to Unicode (RFC 3492) for domains and URLs — in bulk, with a per-label breakdown — plus an IDN homograph phishing detector that exposes lookalike characters attackers use to spoof trusted domains.

Honest scope: this tool implements pure RFC 3492 Punycode per domain label with IDNA-style case folding — the same layer browsers use before a DNS lookup. It does not perform full UTS-46 mapping (e.g. compatibility-character folding); for display purposes browsers apply that separately. Everything runs 100% in your browser — no input ever leaves your device.

Enter a domain, URL, or plain text. münchen.de → xn--mnchen-3ya.de. Try an example:

What Is Punycode?

Punycode is an encoding defined in RFC 3492 that represents Unicode text using only ASCII letters (a–z), digits (0–9) and hyphens. It exists because the Domain Name System was designed for ASCII only — yet people want domain names in their own scripts: German münchen.de, Japanese 日本.jp, Russian президент.рф.

These are called internationalized domain names (IDNs). Before a DNS lookup, each non-ASCII label is Punycode-encoded and prefixed with xn-- — an ACE label (ASCII Compatible Encoding). Your browser shows you münchen.de but actually resolves xn--mnchen-3ya.de.

Human-readable (Unicode)DNS form (Punycode / ACE)
münchen.dexn--mnchen-3ya.de
bücher.dexn--bcher-kva.de
日本.jpxn--wgv71a.jp
президент.рфxn--d1abbgf6aiiy.xn--p1ai
עברית.examplexn--5dbqzzah.example

These examples are produced by the converter above — try them yourself.

How Punycode Encoding Works

Punycode is a bootstring encoding: it copies the ASCII characters of the input as-is, then appends the non-ASCII code points as a compact sequence of deltas from the previous one. Two properties make it clever:

Encoding is fully deterministic: the same input always produces the same output, which is why this tool's engine is verified against the RFC's own published test vectors (Arabic, Chinese, Hebrew, Hindi, Japanese, Korean, Russian, Spanish, Vietnamese and more — 84 automated checks run on every build).

IDN Homograph Attacks: The Security Angle

The same feature that enables international domains enables homograph phishing: registering a domain that looks identical to a trusted one by swapping in lookalike characters from another script. The classic example is Cyrillic а (U+0430) for Latin a — раураl.com renders like paypal.com in many fonts but resolves to an attacker-controlled domain.

Well-known lookalike pairs this detector checks include:

Looks likeActually isScript
aа (U+0430)Cyrillic
eе (U+0435)Cyrillic
oо (U+043E) / ο (U+03BF)Cyrillic / Greek
pр (U+0440) / ρ (U+03C1)Cyrillic / Greek
xх (U+0445) / χ (U+03C7)Cyrillic / Greek
cс (U+0441)Cyrillic
yу (U+0443)Cyrillic
i / jі (U+0456) / ј (U+0458)Cyrillic

How to protect yourself: treat any domain that mixes scripts (e.g. Latin letters plus Cyrillic) as suspicious — legitimate IDNs almost always use a single script. Never enter credentials from an unexpected link; navigate via bookmarks or by typing the address. Paste anything doubtful into the Homograph Detector tab above before trusting it.

Using Punycode in Code

JavaScript / Node.js

For domains, the built-in URL API is enough (the standalone punycode npm module is deprecated):

new URL('https://münchen.de').hostname // 'xn--mnchen-3ya.de'

Python

'münchen.de'.encode('idna').decode('ascii') # 'xn--mnchen-3ya.de'
b'xn--mnchen-3ya.de'.decode('idna') # 'münchen.de'

Java

java.net.IDN.toASCII("münchen.de"); // "xn--mnchen-3ya.de"
java.net.IDN.toUnicode("xn--mnchen-3ya.de"); // "münchen.de"

C#

new System.Globalization.IdnMapping().GetAscii("münchen.de");

Command line

python3 -c "print('münchen.de'.encode('idna').decode())"
echo münchen.de | idn # libidn, Linux/macOS

Excel

Excel has no native Punycode function. For a list of domains, paste them into the Batch tab above and download the CSV — far quicker than writing VBA.

How This Compares

FeatureThis toolTypical online Punycode converters*
Unicode → Punycode✅✅
Punycode → Unicode✅✅ (some one-way only)
Per-label breakdown✅❌
Full-URL mode✅❌
Batch conversion + CSV export✅ (500 domains)❌
Homograph / phishing detector✅❌
Educational content (RFC 3492, IDN guide)✅❌
100% client-side, zero tracking✅Varies

*Based on commonly ranking Punycode converter pages (e.g. toolsina.com, apifreaks.com, dnschecker.org, toolblip.com), which are single input-box tools with little or no explanatory content. Checked October 2026 — features change; verify on the live sites.

Related Security Tools

Frequently Asked Questions

What is Punycode?

Punycode is an encoding defined in RFC 3492 that represents Unicode text using only ASCII letters, digits and hyphens. It is the mechanism behind internationalized domain names (IDNs): a domain like münchen.de is stored in the DNS as xn--mnchen-3ya.de. The xn-- prefix marks the label as Punycode-encoded (called an ACE label). Browsers decode it for display and encode it before doing a DNS lookup.

How do I convert Unicode to Punycode?

Paste the domain or text into the Converter tab above with the direction set to Unicode to Punycode (or Auto). For example, münchen.de becomes xn--mnchen-3ya.de. Each label of a domain is converted separately; labels that are already ASCII pass through unchanged.

How do I convert Punycode back to Unicode?

Set the direction to Punycode to Unicode and paste the encoded form, for example xn--mnchen-3ya.de. The tool strips the xn-- prefix from each label and decodes it, returning münchen.de. Decoding is case-insensitive, so XN--MNCHEN-3YA works too.

How do I convert a full domain name or URL to Punycode?

Use URL mode in the Converter tab, or just paste the full URL — the tool detects it automatically. Only the hostname is converted; the scheme, port, path, query and fragment are left untouched. For example, https://münchen.de/path becomes https://xn--mnchen-3ya.de/path.

What is an IDN and what does the xn-- prefix mean?

IDN stands for internationalized domain name: a domain containing non-ASCII characters such as ü, 中 or р. Because the DNS only understands ASCII, each non-ASCII label is Punycode-encoded and prefixed with xn-- (called an ACE label, for ASCII Compatible Encoding). So münchen.de is the human-readable IDN and xn--mnchen-3ya.de is the ACE form that actually travels over DNS.

What are IDN homograph attacks and how can I spot one?

An IDN homograph attack registers a domain that looks identical to a trusted one but uses lookalike characters from another script — for example, Cyrillic а (U+0430) instead of Latin a in paypal.com. The browser may display the Unicode form, hiding the spoof. Warning signs: a domain that mixes scripts (Latin plus Cyrillic or Greek), certificate or sender mismatches, and links arriving unexpectedly. Paste any suspicious domain into the Homograph Detector tab above to see every lookalike character, the scripts involved, and what the domain visually mimics.

How do I convert Punycode in JavaScript or Node.js?

In browsers and Node.js 10+, the built-in URL API handles domains: new URL('https://münchen.de').hostname returns 'xn--mnchen-3ya.de'. (The standalone punycode npm module is deprecated.) For raw Punycode without the IDN layer, this page's engine is a compact RFC 3492 implementation in plain JavaScript — the same code running in the converter above, verified against the RFC's own test vectors.

How do I convert Punycode in Python, Java, or C#?

Python: 'münchen.de'.encode('idna').decode('ascii') gives 'xn--mnchen-3ya.de', and b'xn--mnchen-3ya.de'.decode('idna') decodes it back. Java: java.net.IDN.toASCII("münchen.de") and IDN.toUnicode(...). C#: new System.Globalization.IdnMapping().GetAscii("münchen.de") and GetUnicode(...). All three are built in — no packages needed.

How do I convert Punycode on the command line (Linux, Mac, Windows)?

The quickest cross-platform way is Python: python3 -c "print('münchen.de'.encode('idna').decode())". On Linux, the idn command (from libidn) also works: echo münchen.de | idn. On Windows PowerShell without Python, you can use .NET: [System.Globalization.IdnMapping]::new().GetAscii('münchen.de').

Can I convert Punycode in Excel?

Excel has no built-in Punycode function. The practical options are: paste the values into the Batch tab of this converter and download the CSV, or use Power Query with a custom function. A VBA implementation is possible but long — for one-off conversions the batch tool here is faster and less error-prone.

Why is my Punycode conversion failing or not working?

Common causes: (1) the input is not valid Punycode — a truncated or mistyped xn-- label throws a decoding error; (2) you are decoding a label without the xn-- prefix, which the tool treats as plain text; (3) a single DNS label exceeds 63 characters after encoding (a hard DNS limit); (4) mixing up direction — make sure Unicode to Punycode vs Punycode to Unicode matches your input. The converter above reports the exact error instead of failing silently.

Does Punycode work with Hebrew, Arabic, Chinese, or emoji?

Yes — Punycode encodes any Unicode code point, so Hebrew (עברית → xn--5dbqzzah), Arabic, Chinese, Cyrillic and even emoji all work. The algorithm is script-agnostic: it only cares about code point values. Try the examples in the converter, e.g. 日本.jp or президент.рф.

Is there a Punycode API, app, or download?

This page is the tool — it runs entirely in your browser with no API, no app install and no download. Because there is no server involved, it also works offline once the page has loaded. If you were looking for a GitHub repository: there is none by design — the whole converter, RFC 3492 engine included, is a single self-contained page with no package or build step. If you need Punycode inside your own software, use the built-in IDN functions of your language (Python's idna codec, Java's IDN class, .NET's IdnMapping, or the URL API in JavaScript) rather than a web API.

How is this Punycode converter different from others?

Most online Punycode converters are a single input box with one-shot conversion and no explanation. This tool adds: bidirectional conversion with per-label breakdown, full-URL mode, batch conversion of up to 500 domains with CSV export, and an IDN homograph/phishing detector that flags lookalike characters (e.g. Cyrillic а vs Latin a) — plus a complete guide to Punycode, IDN and homograph attacks. See the comparison table above (checked October 2026).

Is my data private? Does anything leave my browser?

Everything runs 100% in your browser. The page makes zero network requests after loading — no domain you paste, no conversion you run, ever leaves your device. There is no account, no signup, nothing stored and no analytics on your inputs. You can verify this in your browser's developer tools network panel.

Free tool by NRTechStudio