URL 编码解码工具
对 URL 进行百分比编码以安全用于查询字符串,或将已编码的 URL 解码为纯文本。
Every character that carries special meaning in a URL — spaces, ampersands, equals signs, hash marks — must be percent-encoded before it can safely travel as part of a query string or path segment. Skip this step and browsers, servers, or intermediary proxies will misparse your URL, silently dropping parameters or returning 400 errors that are frustratingly hard to trace.
This tool is essential when building redirect links, constructing API query strings by hand, debugging OAuth callback URLs, or inspecting encoded parameters pasted from server logs. Paste a raw string to encode it for safe embedding, or paste a mangled URL from a log file and decode it back to readable form in one click.
如何在线编码和解码 URL
- 1
粘贴您的 URL 或字符串
将纯文本 URL 或百分比编码的字符串粘贴到输入面板中。
- 2
选择编码或解码
在编码和解码之间切换。编码将不安全字符转换为 %XX 序列,解码则反向操作。
- 3
复制结果
复制编码或解码后的输出。所有处理均在浏览器中进行,不发送服务器请求。
How Percent-Encoding Works
RFC 3986 defines which characters are 'unreserved' in a URI — letters, digits, hyphens, underscores, tildes, and dots — and requires everything else to be encoded as a percent sign followed by two uppercase hex digits representing the byte value. A space becomes `%20`, an ampersand becomes `%26`, and a non-ASCII character like `é` is first UTF-8 encoded to two bytes (`0xC3 0xA9`) and then encoded as `%C3%A9`.
The older `application/x-www-form-urlencoded` scheme (used in HTML form posts) encodes spaces as `+` instead of `%20`, which is why decoding a `+` character requires context — in a query string value it is a space, but in a path segment it is a literal plus sign. This tool handles both conventions correctly.
为什么使用 FileCrank URL 编码解码工具?
- ✓ 支持 RFC 3986 标准编码和表单编码(+)惯例。
- ✓ 完整 URL 模式保留方案和斜杠;组件模式对所有字符编码。
- ✓ 处理非 ASCII 字符,包括 Unicode 和 emoji。
- ✓ 完全在浏览器中运行——不向任何服务器发送数据。
功能与规格
常见问题
URL 编码和百分比编码有什么区别?
它们是同一件事。百分比编码是 RFC 3986 的正式名称,URL 编码是开发者使用的非正式名称。两者都描述了将不安全字符替换为 % 加两个十六进制数字的做法。
空格应该用 %20 还是 +?
在 URL 路径段或查询值中按照 RFC 3986 编码时,使用 %20。只有在 application/x-www-form-urlencoded 表单数据中才使用 +。大多数 API 期望 %20。
此工具是对整个 URL 编码还是只对某个组件编码?
默认情况下,工具对 URL 组件中不安全的每个字符进行编码。如果您粘贴带有方案(https://)的完整 URL,冒号和斜杠将被保留。使用组件模式可对每个保留字符编码。
为什么我的编码 URL 中包含 %2F 而不是斜杠?
您正在对完整路径段进行编码。值内部的斜杠必须编码为 %2F。如果希望保留斜杠,请使用标准 URL 模式而非组件模式。
URL Encoding vs. HTML Entity Encoding
URL encoding and HTML entity encoding solve different problems. Percent-encoding makes data safe for URI syntax, while HTML entities make characters safe for HTML markup. An ampersand in a URL query string needs `%26`; inside an HTML attribute it needs `&`. Using the wrong encoding in the wrong context is a common source of XSS vulnerabilities and broken links, so choosing the right tool for the right layer matters.
相关工具
FileCrank URL 编码解码工具按照 RFC 3986 在纯文本和百分比编码 URL 字符串之间转换,完全在浏览器中运行。
Advertisement