Encode

Punycode / IDN Converter

Convert internationalized domain names between their readable Unicode form and the ASCII-compatible Punycode (xn--) form that DNS actually stores. DevKitLab normalizes each label, encodes the non-ASCII ones with the IDNA Punycode algorithm, and shows a per-label breakdown so you can see exactly which part of the domain became an xn-- label. Decoding works the same way in reverse: paste a string of xn-- labels and read back the original Unicode domain. Everything runs in your browser, so the domains you paste never leave the page.

  • Encodes Unicode domains to ASCII xn-- Punycode and decodes them back
  • Handles multi-label domains, leaving plain ASCII labels untouched
  • Normalizes to NFC and lower case the way registrars and browsers expect
  • Shows a per-label breakdown that flags every internationalized label
  • Decodes label by label, so one malformed xn-- label cannot break the rest
  • Runs entirely in the browser, so the domains you paste are never uploaded
tools/Punycode / IDN Converter
The converted domain will appear here
To ASCII
Conversion commands

Overview

A focused converter for internationalized domain names: turn a readable Unicode domain into the ASCII xn-- form that DNS uses, or decode xn-- labels back into the characters they stand for. It keeps the per-label mapping visible, needs no install, and never sends the domains you paste to a server.

  1. 01

    Encode and decode in one panel

    Convert a Unicode domain into ASCII Punycode and decode xn-- labels back into Unicode from the same place, with no separate convert step. Pick the direction and the result and the per-label breakdown update as you type.

  2. 02

    Whole-domain, label-aware conversion

    The converter splits the domain on dots, encodes or decodes each label on its own, and leaves plain ASCII labels exactly as they are, so com, co, and uk pass through untouched while only the international labels change.

  3. 03

    NFC normalization and case folding

    Input is normalized to Unicode NFC and lower-cased before encoding, the way registrars and browsers prepare a name, so the xn-- output you get matches what real DNS and certificate tooling expect.

  4. 04

    Per-label breakdown

    Switch to the label view to see every label mapped from its source form to its converted form, with an IDN tag on each label that actually became — or came from — an xn-- Punycode label.

  5. 05

    Resilient label-by-label decoding

    Decoding processes each label separately, so a single malformed xn-- label is flagged rather than silently corrupting the rest of the domain, which makes it safe to paste hostnames pulled from logs.

  6. 06

    Accepts the separators browsers accept

    Full stop plus the ideographic and full-width dot variants used in CJK text are all treated as label separators, so a domain copied from East Asian content still splits correctly.

  7. 07

    One-click swap and reuse

    Send the current result back into the input and flip the direction, turning an encode-then-decode round-trip check into a single click.

  8. 08

    Local-only processing

    Encoding, decoding, and the breakdown all run in your browser. The hostnames and domains you paste stay on your device and are never uploaded.

How to use

Paste a domain, choose the direction, and copy the result. Everything recalculates as you type, so there is no separate convert button to press.

  1. 01

    Type or paste a domain into the input — a Unicode domain to encode, or an xn-- Punycode domain to decode.

  2. 02

    Set the direction to To ASCII to produce xn-- Punycode, or To Unicode to read xn-- labels back as characters.

  3. 03

    Read the converted domain in the Domain view, or switch to the Labels view to check each label individually.

  4. 04

    Look for the IDN tag to see exactly which labels were internationalized and how they were rewritten.

  5. 05

    Copy the output, or use Swap to round-trip the result back through the other direction.

Details

Whether to encode or decode, and what to expect from the result, depends on where the domain is headed. A few notes on how the conversion behaves.

  • To ASCII produces the xn-- form that DNS, TLS certificates, email routing, and most APIs store and compare domains in.
  • To Unicode restores the human-readable name, which is what a browser shows in the address bar for a trusted domain.
  • Only labels with non-ASCII characters become xn-- labels; ordinary labels such as com or www are passed through unchanged.
  • Input is normalized to NFC and lower-cased first, because domains are case-insensitive and registries store a single normalized form.
  • Each label is encoded independently, so a domain can mix internationalized and plain labels without any special handling.
  • The label view is the quickest way to confirm which part of a long domain carries the international characters.
  • Decoding tolerates a broken xn-- label by flagging it instead of throwing away the labels around it.
  • Swap makes a fast round-trip check: encode, swap, and confirm the original Unicode domain comes back unchanged.

Use cases

Punycode work shows up wherever an internationalized domain meets a system that only speaks ASCII — DNS records, certificates, email, logs, and link checks.

  1. Registering and configuring IDNs

    Convert a Unicode brand or local-language domain into the xn-- form you enter into a registrar, DNS zone, or hosting panel, then decode it back to confirm it reads correctly.

  2. Issuing and reading TLS certificates

    Produce the ASCII xn-- name a certificate authority expects in a SAN entry, or decode an xn-- name from a certificate to see the human-readable domain it covers.

  3. Debugging email and DNS routing

    Translate between the readable and xn-- forms when an MX record, SPF entry, or mail log shows a domain in the Punycode form you did not expect.

  4. Reading hostnames from logs

    Paste xn-- hostnames copied from server logs, proxy entries, or analytics and read back the actual internationalized domain they represent.

  5. Spotting look-alike and homograph domains

    Decode a suspicious xn-- domain to reveal the Unicode characters behind it, which is how homograph phishing domains disguise themselves as familiar brands.

  6. Building links and redirects

    Generate the ASCII domain to put in a config file, redirect rule, or API request that mishandles raw Unicode, while keeping the readable name for display.

  7. Testing IDN support in tooling

    Create matching Unicode and xn-- pairs to check how a parser, validator, or allow-list handles internationalized domains on both sides.

  8. Teaching how IDNs work

    Show the live mapping from a Unicode domain to its per-label xn-- encoding to explain how the DNS keeps international names ASCII-compatible.

See also

Punycode works at the level of whole domain labels; when you need to escape individual characters instead, the Unicode Converter converts text to and from Unicode escapes. For the path and query parts of an address rather than the host, URL Encoder and Decoder handles URL percent-encoding, and to break a full address into its host, path, and parameters, URL Tools parses and rebuilds URLs. When you instead want a readable ASCII slug from international text, Slug Generator romanizes and cleans it into a URL-safe form.

Best practices

Conversion stays exact when the input is a clean domain and the direction matches the data. A few habits keep encode and decode fully reversible.

  • Paste a bare hostname, not a full URL — strip the scheme, port, path, and query so only the domain labels are converted.
  • Let the tool normalize: it folds case and applies NFC, so you do not need to lower-case or pre-normalize the name yourself.
  • Use the label view to confirm which labels became xn-- before you copy a name into DNS or a certificate request.
  • Treat a decoded domain that mixes scripts or uses unusual look-alike characters as a homograph warning, not a guarantee of safety.
  • Run a round-trip with Swap: encode, swap, and check the original Unicode domain returns unchanged.
  • Remember that ASCII labels are intentionally left alone — if nothing changed, the label simply had no characters that need encoding.
  • Clear the panel when you finish with internal hostnames; local processing keeps data on your device, but the input stays until you remove it.

Limitations

Punycode is a way to write a domain in ASCII, not a way to validate or secure it. A few limits are worth keeping in mind.

  • Encoding a domain does not register it or check that it exists — it only rewrites the name into its ASCII form.
  • The converter applies NFC and case folding but not the full UTS-46 validity checks a registrar enforces, so a name it encodes may still be rejected at registration.
  • Convert the host only: paste a bare domain rather than a complete URL, since the scheme, path, and query are not Punycode-encoded.
  • A decoded xn-- domain shows the characters it contains but cannot tell you whether those characters are a legitimate brand or a look-alike homograph.
  • Punycode is an encoding, not encryption — anyone can decode an xn-- name back, so it hides nothing.
  • A label that is not valid Punycode is flagged rather than guessed at, so a corrupt xn-- string will report an error instead of returning misleading text.

FAQ

Common questions about Punycode, internationalized domains, the xn-- prefix, homograph domains, and how this conversion differs from URL encoding.

What is Punycode and the xn-- prefix?

Punycode is the encoding that represents Unicode domain labels using only the ASCII letters, digits, and hyphen that DNS allows. Each internationalized label is prefixed with xn-- followed by the encoded characters, so münchen becomes xn--mnchen-3ya. The readable Unicode name and the xn-- name point to the same domain.

How do I convert a domain to Punycode?

Set the direction to To ASCII and paste your Unicode domain, such as münchen.de or 你好.com. The tool normalizes and encodes each label as you type, leaving plain ASCII labels alone and prefixing the internationalized ones with xn--.

How do I decode an xn-- domain back to Unicode?

Set the direction to To Unicode and paste the xn-- domain. Each label is decoded on its own, so the international labels turn back into characters while ordinary labels such as com pass through unchanged.

Why does only part of my domain change?

Only labels that contain non-ASCII characters need encoding. A label like com, www, or co already fits the DNS character set, so it is left exactly as it is. The label view marks each label that actually became, or came from, an xn-- label.

What is a homograph or look-alike domain?

A homograph domain uses Unicode characters that look like familiar Latin letters to impersonate a known brand. Decoding the xn-- form reveals the real characters behind the name, which is why checking the Unicode of a suspicious xn-- domain is a useful phishing check.

How is Punycode different from URL encoding?

Punycode encodes the domain (host) part of an address so DNS can store international names, while URL percent-encoding handles the path and query. They apply to different parts of a URL, so use the URL encoder for everything after the host.

Does my domain get uploaded anywhere?

No. Encoding, decoding, and the per-label breakdown all run in your browser. Nothing you paste is sent to a server, so internal hostnames and domains stay on your device.

Related tools

Keep exploring Unicode escapes, URL encoding, and slug generation without leaving the tools collection.