跳转到主要内容

Punycode 转换器

将国际化域名转换为 Punycode(xn--)格式,或将其转换回 Unicode。

Input
0 chars | 0 bytes
Encode
Output
0 chars | 0 bytes

The internet's domain name system was designed around ASCII characters, but users around the world want to register domains in Arabic, Chinese, Cyrillic, Japanese, and hundreds of other scripts. Punycode is the algorithm that bridges these two worlds, encoding Unicode domain labels into the ASCII-compatible `xn--` prefix format that DNS can handle without modification.

This tool converts human-readable internationalized domain names — like `münchen.de` or `日本語.jp` — to their Punycode equivalents and back. It is useful for web developers implementing IDN support, security researchers investigating homograph attacks, DNS administrators checking zone files, and anyone debugging why an internationalized domain is not resolving as expected.

如何在线转换 Punycode

  1. 1

    输入域名

    输入 Unicode 域名(如 münchen.de)或 Punycode 域名(如 xn--mnchen-3ya.de)。

  2. 2

    自动转换

    工具检测输入类型并向适当方向转换——Unicode 转 Punycode 或 Punycode 转 Unicode。

  3. 3

    验证结果

    使用输出验证 DNS 记录、证书或电子邮件路由。正确处理多标签域名和 ASCII/非 ASCII 混合标签。

How Punycode Encoding Works

Punycode (RFC 3492) is a form of bootstring encoding — it encodes a sequence of Unicode code points into a restricted set of ASCII characters. The algorithm first copies all ASCII characters from the input to the output unchanged, then appends a hyphen delimiter, and finally encodes the positions and code points of the non-ASCII characters as a sequence of base-36 digits using a variable-length delta encoding. The result is prefixed with `xn--` to mark it as an ACE (ASCII Compatible Encoding) label.

For a full internationalized domain name, each label (the dot-separated components) is encoded independently. `münchen.de` becomes `mnchen-3ya.de` because only the label `münchen` is internationalized. Security researchers have demonstrated that Punycode makes homograph attacks possible — `аррle.com` using Cyrillic characters looks identical to `apple.com` — which browsers now mitigate by displaying the Punycode form when the label mixes scripts.

为什么使用 FileCrank Punycode 转换器?

  • ✓ 在 Unicode 域名和 xn-- Punycode 之间双向转换。
  • ✓ 处理多标签域名和 ASCII/非 ASCII 混合标签。
  • ✓ 有助于检测同形字钓鱼攻击。
  • ✓ 完全在浏览器中运行——不向任何服务器发送数据。

功能与规格

最大文件大小
最大 100 MB
隐私
文件在约一小时后删除
价格
免费,无需注册
处理方式
100%客户端
您的数据永不离开浏览器——所有处理均在本地完成。无需注册账户。免费使用,无限制。

常见问题

什么是 Punycode,它为什么存在?

DNS 系统最初只支持 ASCII。Punycode(RFC 3492)通过将非 ASCII 字符(阿拉伯语、中文、希伯来语、重音拉丁字母)编码为以 xn-- 开头的 ASCII 字符串,使域名支持这些字符。

如何判断一个域名是否使用了 Punycode?

Punycode 标签以 xn-- 开头。如果您在证书或 DNS 记录中看到 xn--bcher-kva.example 这样的域名,说明它是 Punycode 编码的 IDN。用此工具解码以查看 Unicode 等效形式。

Punycode 可用于钓鱼攻击吗?

可以——这就是已知的同形字攻击。来自不同文字体系但外观相同的字符会产生不同的 Punycode。此工具帮助您验证 Punycode 字符串解码后是否为您期望的域名。

此工具支持所有 Unicode 文字体系吗?

支持。它处理可能出现在国际化域名中的任意 Unicode 码位,包括阿拉伯语、中文、梵文、希伯来语、日语、泰语以及所有扩展拉丁字符。

Punycode Converter vs. Browser Address Bar vs. dig

Modern browsers convert IDNs automatically and can display either the Unicode or Punycode form, but they do not expose the intermediate encoding steps. The `dig` command resolves domain names but does not perform Punycode encoding itself. A dedicated Punycode converter is the right tool when you need to inspect the encoding explicitly — for DNS zone file authoring, IDN debugging, security research into homograph attacks, or verifying that a non-ASCII domain name will resolve correctly.

FileCrank Punycode 转换器在 Unicode 和 ASCII 兼容的 Punycode 格式之间编码和解码国际化域名(IDN),完全在浏览器中运行。

Advertisement

Ad