URL 编码与解码器 — 免费在线工具
使用此免费在线工具即时编码和解码 URL。支持 encodeURIComponent 和 encodeURI 模式,适用于查询字符串和完整 URL。无需注册。
AI developer workflow fit
Use URL 编码与解码器 — 免费在线工具 while building with AI coding assistants, agents, and LLM workflows: validate generated output, transform payloads, debug integrations, and prepare reliable inputs without leaving your browser.
URL 编码与解码器free URL 编码与解码器online URL 编码与解码器URL 编码与解码器 for developersURL 编码与解码器 for AI developersURL 编码与解码器 for vibe codingURL 编码与解码器 no signupURL 编码与解码器 browser toolurlencode
什么是 URL 编码(百分号编码)?
URL 编码,也称为百分号编码,是 RFC 3986 中定义的一种在 URI 中表示特殊字符的机制。URL 中不允许出现的字符(如空格、与号、问号和非 ASCII 字符)会被替换为百分号加上其两位十六进制值(例如空格变为百分号20)。JavaScript 提供了两个内置函数:encodeURIComponent() 对所有特殊字符进行编码(适用于查询参数值),而 encodeURI() 保留 URL 结构字符如冒号、斜杠、问号和井号(适用于编码完整 URL 而不破坏其结构)。
How to use URL 编码与解码器 — 免费在线工具
- Paste, upload, or enter the url, encode, decode, percent, encoding, uri input required by the tool.
- Adjust any options such as format, mode, output style, size, or validation behavior.
- Review the generated result, parsed details, warnings, or converted output in the preview area.
- Copy or download the result for tests, documentation, API debugging, game assets, or AI coding prompts.
Common URL 编码与解码器 — 免费在线工具 use cases
- Developer debugging — Use URL 编码与解码器 — 免费在线工具 to quickly inspect generated output, API payloads, configuration values, or encoded data while building and debugging software.
- AI-assisted coding workflows — Validate or transform examples produced by AI coding assistants before pasting them into source code, tests, documentation, or issue comments.
- Privacy-first browser processing — Run common url, encode, decode, percent, encoding, uri tasks locally in the browser without sending sensitive development data to a backend service.
FAQ
encodeURI 和 encodeURIComponent 有什么区别?
encodeURI() 编码完整 URI,但保留属于 URL 语法的字符(如 ://?#&=)。encodeURIComponent() 编码除 A-Z、a-z、0-9 和 - _ . ~ 之外的所有字符,适用于查询参数值,因为这些结构字符也必须被转义。
为什么空格在 URL 中显示为 %20 或 +?
在标准百分号编码(RFC 3986)中,空格编码为 %20。在使用 application/x-www-form-urlencoded 的 HTML 表单提交中,空格编码为 +。两者都表示空格,但 %20 是 URL 的通用标准。
URL 编码和 HTML 实体编码是一样的吗?
不是。URL 编码(百分号编码)用于使字符串在 URL 中安全使用。HTML 实体编码(如用 'amp' 实体表示与号)用于使字符串在 HTML 标记中安全使用。它们用途不同,语法也不同。
这个工具免费且保护隐私吗?
是的。此工具完全在浏览器中使用 JavaScript 内置编码函数运行,不会向任何服务器发送数据,也无需注册。