URL

URL 编码/解码

URL 编码与解码

🔒 100% client-side — your data never leaves this page
输入
输出
Output will appear here

About this tool

对 URL 中的特殊字符进行百分比编码使其安全传输,或将编码后的 URL 解码为可读文本。

Frequently Asked Questions

What is URL encoding?

URL encoding (percent encoding) replaces special characters with a % followed by their hex code. For example, a space becomes %20. This ensures URLs only contain valid ASCII characters.

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a full URL and leaves characters like / and ? intact. encodeURIComponent encodes a URL component and also encodes those characters. Use encodeURIComponent for query string values.

What is the difference between encodeURI and encodeURIComponent?

Use encodeURIComponent for query parameter values, and encodeURI for full URLs. This tool shows both results so you can copy the right one.