DevToolBox免费
博客

URL 编码 / 解码

编码或解码 URL 和 URI 组件。支持 encodeURIComponent 和 encodeURI。免费使用,无需注册。

About URL Encoding

URL encoding replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits. This is essential for passing special characters in URLs, query parameters, and form data. Use encodeURIComponent for query parameters and encodeURI for full URLs.

常见问题

𝕏 Twitterin LinkedIn

评价此工具

4.7 / 5 · 107 人评价

保持更新

获取每周开发技巧和新工具通知。

无垃圾邮件,随时退订。

Enjoy these free tools?

Buy Me a Coffee

使用方法

  1. Enter text in the input field
  2. Choose between URI Component or Full URI encoding mode
  3. Click 'Encode' or 'Decode'
  4. Copy the result

常见用途

  • Encoding query parameters in URLs
  • Encoding form data for submission
  • Handling special characters in API requests
  • Debugging URL encoding issues

常见问题

What is URL encoding?
URL encoding replaces unsafe ASCII characters with a '%' followed by two hex digits. This ensures special characters are safely transmitted in URLs.
What's the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL but preserves characters like :, /, ?, &. encodeURIComponent encodes everything including those characters, making it suitable for query parameter values.
When should I URL encode?
Always URL encode when passing user input as query parameters, form data, or any URL component that may contain special characters like spaces, &, =, or #.