Encode a domain name as Punycode

Convert an internationalized domain label to its ASCII Punycode form.

freeworks offlinenothing uploaded
ToolPunycode Encode
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Non-ASCII Unicode labels are transformed with Punycode’s bootstring algorithm into ASCII letters, digits, and hyphens; an xn-- prefix marks an A-label for DNS use. The conversion operates per label rather than across an entire dotted hostname.

  • ASCII labels preserve DNS compatibility while retaining a reversible Unicode mapping.

Worked example

Encode Unicode Domain
Encode a domain with Unicode characters to Punycode
Input
											üöä.com
										
Output
												xn--4ca9ar.com
											

When to use this

IDN registration, URL parsing, and certificate SAN handling encode domain labels.

Edge cases

  • The dot separator must not be encoded as part of one label.
  • Mixed-script lookalikes can remain visually deceptive after encoding.
  • A trailing hyphen or invalid code point is not a valid DNS label.

References