Skip to content

IDN Punycode Converter - Unicode Domains ↔ xn-- Both Ways

Free IDN ↔ punycode converter: Unicode domains to xn-- ASCII and back. Forward uses the WHATWG URL reference implementation; reverse decodes per RFC 3492. Batch, fully local.

Was this result helpful?

This tool runs in your browser: what you enter is processed on your device and normally never appears in a request to any server.

Usage Guide

An IDN like example.公司 lives in DNS as an xn-- Punycode string. Debugging resolution, configuring certificate SANs, and matching log entries all require flipping between the Unicode display form and the ASCII wire form. Forward conversion here follows the WHATWG URL Standard (the same rules browsers apply); reverse decoding follows RFC 3492, with per-label output. Conversion is fully local — fine for public domain data.

1. How to use

Certificate work, DNS panel entry, and log forensics are the three highest-frequency consumers.

  1. Paste a domain (multi-level subdomains welcome). Pasting an xn-- form triggers reverse decoding.
  2. Each label is processed separately: non-ASCII labels are Punycode-encoded with the xn-- prefix; pure-ASCII labels pass through.
  3. The result notes case handling (DNS is case-insensitive; the xn-- prefix is canonically lowercase) and trailing-dot behavior.

2. What Punycode is

DNS infrastructure accepts ASCII only. Internationalized domains are squeezed into ASCII via RFC 3492 Punycode: xn-- plus base characters plus delta-encoded extensions. 例子 becomes xn--fsqu00a; 日本語.jp becomes xn--wgv71a119e.jp. Encoding applies per label — the dot structure is untouched.

3. Two directions, two standards

Forward (Unicode → ASCII) follows the WHATWG URL Standard — the browser’s actual behavior, including case normalization and forbidden-character filtering (full-width dots fold to ASCII dots). Reverse follows RFC 3492 with explicit errors on malformed xn-- sequences instead of silent output. The distinction matters: feeding full-width input to a bare RFC algorithm produces results that disagree with every browser.

4. High-frequency scenarios

  • Certificate SANs: certs store the ASCII form; encode before comparing against the panel’s Unicode display.
  • Log forensics: gateways log only xn--; decode to align with business-side domain names.
  • E-mail domains: IDN mail addresses use the ASCII form on the wire; transcode when debugging bounces.
  • Phishing triage: xn-- prefixes can disguise lookalikes (xn--paypal-…); decoding one is a quick sanity check.

5. Common questions

  • “Browser shows Unicode, curl fails”: many CLI tools do not auto-encode — pass the xn-- form.
  • Case: DNS is case-insensitive but lowercase is canonical; output is lowercased.
  • Decode failures: not every xn-- string is valid Punycode; the tool errors out and keeps your input rather than guessing.
  • Trailing dots (FQDN) are preserved as-is and not treated as characters.

FAQ

DNS is ASCII-only, so an internationalized domain is actually stored as Punycode with the xn-- prefix — 例子 becomes xn--fsqu00a. The two are the display and wire forms of the same name, and the tool converts in both directions, label by label across subdomains, leaving pure-ASCII labels untouched.

Yes. Forward conversion follows the WHATWG URL Standard — the browser's exact rules, including folding full-width punctuation and lowercasing the output; reverse decoding follows RFC 3492 and reports invalid sequences while keeping the original, never a guess. A trailing FQDN dot is preserved and never treated as input.

Certificates store the ASCII form: encode the domain here first, then compare against the SAN. The same goes for Nginx and gateway logs, which contain only xn-- forms — decode them back to align with the names your business side uses.

Browsers encode automatically; many command-line tools don't — hand curl the xn-- form directly. Email domains behave the same way, since SMTP also carries the ASCII form, which matters when you are tracing bounces.

Paste it in and decode it to see what it really is. Punycode is a classic phishing disguise, and the decoded form reveals the actual characters at a glance.

No — encoding happens entirely inside the page, with no network transfer of any kind.

Related Tools

Related Articles