Allio Tools Pro — No ads · Bulk processing · Save historyUpgrade $2.99/mo →
🚀Allio Tools Pro
  • No ads
  • Bulk tools
  • History
$2.99/mo

免费URL编码器和解码器

Thanks for rating!

使用百分比编码(RFC 3986)对URL进行编码和解码。

🚀Allio Tools Pro
  • Zero ads everywhere
  • Bulk processing
  • Save history
Upgrade — $2.99/moNo signup required
Allio Tools Pro — No ads · Bulk processing · Save historyUpgrade $2.99/mo →

Who uses the URL编解码?

  • 开发者在将查询字符串值附加到 API 端点网址前进行编码。
  • SEO 专员解码百分号编码的网址以核实追踪参数。
  • 后端工程师调试请求路径中含特殊字符的网址解析问题。

How the URL编解码 works

1

将文本或网址粘贴到输入框中。

2

点击 Encode,将特殊字符转换为百分号编码(例如空格 → %20,& → %26)。

3

点击 Decode,将百分号编码序列转换回可读字符。

4

点击 Copy Output,将结果复制到剪贴板。

Tips & tricks

  • 本工具使用 encodeURIComponent——它比 encodeURI 编码更多字符,因此适用于单个值,而非整个网址。
  • 解码无效的百分号编码序列时会显示错误,而不是猜测结果。
  • 像 / 和 ? 这样的保留字符也会被编码,所以不要把整个网址放进 Encode——只编码单个参数值。
  • 编码是可逆的:先 Encode 再 Decode 会精确还原你的原始文本。

Frequently Asked Questions

什么是网址编码,为什么需要它?

网址只能包含有限的字符集。特殊字符(空格、&、=、?、# 等)必须编码为 %XX 的形式,其中 XX 是十六进制 ASCII 值。不编码的话,浏览器会误解网址结构。

encodeURI 和 encodeURIComponent 有什么区别?

encodeURI 编码整个网址,保留结构字符(/、?、&、=、#)不变。encodeURIComponent 会编码除字母、数字和 - _ . ! ~ * ' ( ) 之外的所有字符——本工具使用 encodeURIComponent,适用于单个值。

网址中的空格如何编码?

标准网址编码将空格转换为 %20。HTML 表单编码将空格转换为 +(加号)。两者在不同场景下都有效——HTML 表单中的查询参数常使用 +。

可以编码带查询参数的完整网址吗?

只需输入要编码的查询参数值,而不是完整网址。编码整个网址会连斜杠和冒号一起编码,破坏网址结构。先编码各个参数值,再组装网址。

哪些字符不需要进行网址编码?

A-Z、a-z、0-9 以及未保留字符 - _ . ~ 在任何网址场景下都是安全的,无需编码。其余字符在查询字符串值中都应进行百分号编码。

Is my data safe when using the URL编解码?

Completely safe. The URL编解码 processes everything locally in your browser. No input data, results, or usage information is ever transmitted to or stored on any server.

Can I use the URL编解码 output in commercial projects?

Yes. The URL编解码 is a utility tool and its output carries no licensing restrictions. You are free to use results in any project, commercial or personal.

Does the URL编解码 follow official standards?

Yes. The URL编解码 is built to comply with the relevant industry standard or specification for this utility type. If you encounter an unexpected result, verify your input against the specification — edge cases outside the standard may produce undefined behaviour.

💼 Reach 100K+ developers & creators — Advertise on Allio ToolsLearn More →