Converts Unicode text to Punycode format, essential for internationalized domain names (IDNs). Use via MCP in Cursor or Windsurf for domain validation, or call GET /v1/encode/punycode/encode directly. Input "münchen.de" returns "xn--mnchen-3ya.de" — the ASCII-compatible encoding that DNS systems require for non-Latin domains.
curl "https://tinyfn.io/v1/encode/punycode/encode" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/encode/punycode/encode', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/encode/punycode/encode',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's encoding tools:
{
"mcpServers": {
"tinyfn-encoding": {
"url": "https://tinyfn.io/mcp/encoding",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Punycode converts Unicode characters to ASCII-compatible format that DNS systems can handle. International domain names like 中国.com become xn--fiqs8s.com in Punycode.
Call the punycode encode tool with your Unicode domain. The MCP tool returns the xn-- prefixed ASCII version that browsers and DNS servers recognize.
Pure ASCII text passes through unchanged since it's already DNS-compatible. Only non-ASCII Unicode characters get the xn-- encoding treatment.
Punycode only applies to domain parts. For email addresses like user@café.com, only encode the domain portion (café.com → xn--caf-dma.com).
Yes, Punycode is reversible. The encoded xn-- format contains all information needed to decode back to the original Unicode characters perfectly.
Get your free API key and start using Punycode Encode in seconds.
Get Free API Key