toolfree

Punycode converter

Convert internationalised domain names to and from Punycode in your browser, and see when a domain mixes scripts to impersonate another.

Runs in your browser

Enter a domain name.

What Punycode is for

DNS carries ASCII. A domain written in Chinese, Arabic or with a German umlaut has to be turned into ASCII before it can be looked up, and Punycode is that transformation: 台灣.tw becomes xn--kpry57d.tw.

The xn-- prefix marks a label as encoded. Everything after it is the original characters, packed into letters and digits by an algorithm that is reversible but not readable.

You will see the encoded form in certificate names, DNS records, mail headers and server logs, which is usually why you need to decode one.

The half that matters: lookalike domains

Punycode conversion is arithmetic. The interesting question is whether a domain is trying to impersonate another one.

аpple.com — with a Cyrillic а — is a completely different domain from apple.com, and in most fonts the two are indistinguishable. That is a homograph attack, and it is the reason this page reports the scripts used in each label.

The signal is not “contains Cyrillic”. Plenty of legitimate domains are entirely Cyrillic — москва.рф is an ordinary Russian domain, and every letter in it is a Latin lookalike. What is suspicious is a single label mixing scripts: one Cyrillic character among Latin ones has no innocent explanation.

So the check here is per label, and a domain in one script is never flagged, in any script. That is also, roughly, what browsers do: a mixed-script label is displayed as its Punycode rather than as letters, which is why a phishing domain sometimes shows up as xn-- gibberish in the address bar.

The conversion is the browser’s own

new URL() performs IDNA exactly as the browser does when it resolves a link, so what you see here is what your browser would do — not a reimplementation that might differ in the edge cases that matter.

Decoding is implemented directly, since there is no platform API for that direction.

中文域名

Chinese domains are ordinary IDNs: 台灣.tw, 香港.hk, 中国.cn. They resolve normally and have done for years, but they are frequently mangled by software that predates IDN — which is when you need the ASCII form to paste into it.

Note that traditional and simplified forms are different domains. 台灣.tw and 台湾.tw encode differently and are registered separately, which is a real source of confusion in the region.

Nothing is uploaded

Converted in this page, with no DNS lookup — this tells you what a name encodes to, not whether it exists.