Punycode converter
Convert internationalised domain names to their ASCII "xn--" form and back.
Input
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
| Name | Type | Required | What 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.
Related tools
- URL encoder and decoderPercent-encode text for use in a URL, or decode it. Works on one value or a whole URL.
url-encode - URL parserSplit a URL into scheme, login, host, port, path, query parameters and fragment.
url-parse - String bytes and code pointsShow the UTF-8, UTF-16 and UTF-32 bytes and the Unicode code points of a text.
string-escape-bytes - All hashes at onceCompute every supported hash of one input at once: MD5, SHA-1, SHA-2, SHA3-256 and BLAKE2b.
hash-all - Base32 encoder and decoderEncode text to Base32 (RFC 4648) or decode it back, with or without padding.
base32 - Base58 encoder and decoderEncode text or bytes to Base58 with the Bitcoin alphabet, or decode Base58 back.
base58