Punycode converter

Convert internationalised domain names to their ASCII "xn--" form and back.

Input

The domain name to convert.
Encode a Unicode domain to ASCII, or decode an "xn--" domain to Unicode.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/punycode \
  -H 'Content-Type: application/json' \
  -d '{"input":{"text":"münchen.de"}}'
import json, urllib.request

body = {'input': {'text': 'münchen.de'}}
request = urllib.request.Request("https://setget.net/v1/tools/punycode", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/punycode", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"text":"münchen.de"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "punycode",
  "input": {
    "text": "münchen.de"
  }
}
{
  "input": {
    "text": "münchen.de"
  }
}

Endpoint: POST /v1/tools/punycode. Over MCP: run_tool with slug: "punycode". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
text string yes The domain name to convert.
action string no Encode a Unicode domain to ASCII, or decode an "xn--" domain to Unicode. One of: encode, decode. Default: "encode".

Examples

Input
{
  "text": "münchen.de"
}
Result
{
  "text": "xn--mnchen-3ya.de",
  "changed": true
}
Input
{
  "text": "xn--mnchen-3ya.de",
  "action": "decode"
}
Result
{
  "text": "münchen.de",
  "changed": true
}

Every label is converted on its own

Input
{
  "text": "例え.テスト"
}
Result
{
  "text": "xn--r8jz45g.xn--zckzah",
  "changed": true
}

Questions

What is the "xn--" prefix?
It marks a domain label that holds non-ASCII characters in encoded form. DNS itself only carries ASCII, so browsers convert names both ways.
Why did "ß" become "ss"?
Encoding follows the older IDNA 2003 rules, which fold a few characters: the German sharp s becomes "ss" and capitals become lower case. Registries using IDNA 2008 keep "ß" as its own character.
Why can look-alike domains be dangerous?
Letters from different scripts can look identical, for example Latin "a" and Cyrillic "а". Decoding an "xn--" name here shows what it really contains.