URL 编码 / 解码

使用 encodeURIComponent / decodeURIComponent,适合查询参数与路径片段。

常见问题

编码行为和 JavaScript 的 encodeURIComponent 一致吗?

一致。本工具直接调用浏览器原生的 encodeURIComponent / decodeURIComponent,结果与在 JS 代码中执行完全相同。

为什么有些字符没有被编码?

encodeURIComponent 按标准不编码字母、数字以及 - _ . ! ~ * ' ( ) 这些保留字符,属于预期行为。

数据会上传服务器吗?

不会。编码与解码均为纯本地处理。