How Punycode Represents International Domain Names

Convert a Unicode domain label to its Punycode-based ASCII form, check the round trip, and see why conversion alone does not prove registrability.

FBFenwei BianAuthorNov 24, 2026
  • domains
  • dns
  • internationalization
  • guide

Punycode is an encoding used in internationalized domain names to represent a Unicode label with ASCII characters. In a domain, IDNA gives the ASCII form of an internationalized label the prefix xn--. For example, café.example becomes xn--caf-dma.example. The label example stays unchanged. RFC 3492 defines the encoding. RFC 5890 defines the IDNA label forms.

Follow one label from display to DNS and back

Start with the hostname alone. A URL scheme, path or query string does not belong in a label converter. Split café.example into its two labels at the dot. The first label, café, is the Unicode form. IDNA calls a valid Unicode label containing a non-ASCII character a U-label. For this label, the Punycode output is caf-dma. Adding xn-- gives the A-label xn--caf-dma. Compare the result with the original by decoding the A-label back to café. Treat .example as a documentation suffix in this walkthrough. IANA explains the special-use example names.

ObservationExample
Unicode hostnamecafé.example
Label that needs encodingcafé
ASCII DNS formxn--caf-dma.example
Decoded first labelcafé

Keep both forms in a handoff to another team. The Unicode spelling is the one a reader recognizes. The A-label is the one to compare when a DNS response, certificate inspector or configuration interface shows ASCII. The copyable text removes uncertainty about which spelling your team means.

Run three separate checks before you register a name

  1. Verify the intended Unicode string. The é in the example can be a single character or appear visually the same as e followed by a combining accent. An IDNA-aware processor checks normalization and applicable code-point rules. Inspect the original spelling before judging the displayed output.
  2. Verify the IDNA form. The xn-- prefix alone cannot prove the label is valid. The encoding must decode to a valid U-label and round-trip under the IDNA rules. Use an IDNA-aware converter for a domain input rather than a generic Punycode encoder. RFC 5891 describes registration checks.
  3. Verify the extension’s policy. An IDNA-valid label may still be ineligible for a particular extension. Verify its supported scripts, any variant rules and actual availability with the registry or registrar. IANA publishes registry-submitted IDN practices.

Compare the same identity across systems

Suppose your registrar shows café.example and a lookup tool shows xn--caf-dma.example. Convert the hostname through one known IDNA-aware implementation and compare the complete A-label form. If the expected forms agree, continue with the ordinary DNS lookup workflow and check the relevant record type. If the strings differ, resolve the identity before editing records or making any purchase. A successful conversion answers what one string encodes. It cannot establish what a registry offers or whether a real website has been configured.

Sources and further reading

About the author(s)

Software Developer & Writer • Namefi
FBAuthor

Fenwei Bian is a software developer in her thirties who spends her working hours in pull requests and her weekends with her hands in soil or sawdust. Years of open source on GitHub taught her that names are interfaces: a good one is clear, honest about what it does, and kind to whoever has to use it next.

She gardens because it rewards patience and punishes wishful thinking, and she does woodwork because a joint either fits or it doesn't. Both habits show up in how she writes about naming — measure twice, check the source, and don't sand over a rough spot and hope no one notices.

For Namefi she writes about how domain markets actually move, the practical trade-offs of tokenizing and flipping names, and picking a domain you'll still be glad you own in twenty years.

Related guides

Discuss this post

View the discussion on Namefi Discuss