URL编解码

在线URL编码和解码工具,支持 encodeURI 和 encodeURIComponent 两种模式。

当前模式:URL编码 (encodeURI)

encodeURI 不会编码 URL 中的保留字符,如 : / ? # & = + $ , 等。适用于对完整 URL 进行编码。

输入
输出结果
两种编码模式的区别
字符 encodeURI encodeURIComponent
:不编码%3A
/不编码%2F
?不编码%3F
#不编码%23
&不编码%26
=不编码%3D
+不编码%2B
%E4%B8%AD%E4%B8%AD
空格%20%20

使用建议:对完整 URL 编码时使用 encodeURI;对 URL 参数值等组件编码时使用 encodeURIComponent