DevTools Logo

Punycode Converter

Punycode Converter

Convert internationalized domains and URLs between Unicode and ASCII (xn--) locally.

Runs in your browser
Labels convert independently; in URLs only the hostname changes.
Try an example

Domains, labels or URLs

empty · one entry per line

ASCII result

No converted domain yet

Type an internationalized domain, URL, or load an example.

Examples

German domain

Input
bücher.example
Output
xn--bcher-kva.example

One non-ASCII label is encoded; the ASCII label stays untouched.

Japanese label

Input
例え.example
Output
xn--r8jz45g.example

The RFC 3492 reference vector demonstrates multi-byte code point handling.

Invalid payload

Input
xn--invalid!.com
Output
Invalid Punycode label

A character outside the Punycode alphabet is rejected with its label named.

About this tool

Domain names on the wire are ASCII, but users type names in their own scripts. IDNA solves this by encoding non-ASCII labels as xn-- followed by Punycode. This converter moves between the two representations and shows every label of the hostname separately.

The implementation is a direct, dependency-free transcription of the RFC 3492 bootstring algorithm: basic code points are copied, then non-basic code points are encoded as variable-length digits with an adaptive bias. Decoding reverses the process and validates each digit, so malformed payloads produce an actionable error rather than garbled text.

Conversion runs entirely in the browser. The tool checks empty labels, the 253-character domain limit and the 63-character per-label limit after encoding; it does not perform DNS resolution or validate whether a domain is registered.

What this tool does not do

  • This is RFC 3492 Punycode conversion, not full IDNA2008 UTS #46 mapping or normalization.
  • No DNS lookup, registration check or homoglyph policy is applied to the result.
  • Uppercase ASCII labels are preserved when encoding a whole domain; the Punycode payload itself uses lowercase digits.

How to use this tool

  1. Paste a hostname

    Enter a Unicode domain such as bücher.example or an ASCII form such as xn--bcher-kva.example.

  2. Choose a direction

    Use Unicode → ASCII to encode, or ASCII → Unicode to decode xn-- labels.

  3. Inspect labels

    The table shows each label's original, ASCII and Unicode forms and marks how many were encoded.

  4. Copy the result

    Copy or download the converted hostname. Mod+Shift+Enter copies from anywhere in the tool.

Use cases

Register an international domain

See the ASCII form a registrar or DNS zone file requires before submitting an IDN.

Debug hostname bugs

Decode an xn-- label to confirm which Unicode characters a link actually contains.

Security review

Inspect lookalike domains encoded in Punycode when triaging phishing reports.

Learn IDNA

Compare the original and encoded label side by side while reading RFC 3492.

IDNA representation

PartMeaning
xn-- prefixACE label marker defined by IDNA; case-insensitive in practice
Basic code pointsASCII characters copied before the last hyphen in the Punycode payload
Encoded digitsVariable-base digits for the remaining Unicode code points
Dot separatorLabels are encoded independently; dots are never part of a Punycode payload

A label cannot exceed 63 ASCII characters after encoding; a whole domain cannot exceed 253.

Common mistakes

Mistake:Encoding the entire hostname as one Punycode string.

Fix:Dots separate labels and are never encoded. The tool converts each label independently.

Mistake:Assuming xn-- means the text is encrypted.

Fix:Punycode is a reversible encoding, not encryption; anyone can decode the label.

Mistake:Ignoring the 63-character label limit after encoding.

Fix:A Unicode label may fit while its xn-- form does not. The validation reports the encoded length.

Frequently asked questions

What is Punycode and why does my domain need it?

Punycode is a way to represent Unicode code points using only ASCII characters. DNS hostnames historically allow ASCII letters, digits and hyphens, so IDNA encodes non-ASCII labels with an xn-- prefix plus a Punycode payload. A browser usually performs this conversion when you visit an internationalized domain; the tool lets you inspect it explicitly.

How do I decode an xn-- domain?

Paste the hostname, choose ASCII → Unicode, and read the result. Labels that do not start with xn-- stay untouched, so xn--bcher-kva.example becomes bücher.example with only the first label changed. If the payload is malformed, the tool names the invalid label and explains the problem.

Is Punycode encryption?

No. It is a deterministic, reversible encoding defined by RFC 3492. The output may look opaque, but anyone can decode it; it provides no confidentiality or integrity. Do not use it to hide sensitive data.

Why is my encoded label rejected?

IDNA limits each label to 63 ASCII characters after encoding and the full hostname to 253 characters. A Unicode label can look short but produce a long xn-- form. Empty labels (leading, trailing or doubled dots) and characters outside the Punycode alphabet are also rejected with an explanation.

Does this tool normalize or validate IDN rules?

It implements RFC 3492 Punycode conversion, not the full IDNA2008/UTS #46 pipeline of case folding, NFC normalization and script validation. If you need registration-ready hostnames, apply those rules in your registrar or a dedicated IDNA library.

Does the domain leave my browser?

No. Encoding, decoding, validation and export are all local. The tool does not resolve the hostname, contact a registrar or send content anywhere.

References & standards