URL Encode / Decode

Free online URL encoding and decoding tool. Supports two encoding modes (encodeURIComponent for query parameters, encodeURI for URL paths), form-encoding mode, smart auto-detection, and character-level encoding breakdown. All processing happens in your browser — nothing is sent to a server.

Input length: 0 chars Output length: 0 chars Change: Mode: encodeURIComponent

Input

Output

Character-level breakdown — see how each character gets encoded
URL encoding reference table — common character percent-encoding mappings
CharEncodingDescriptionCharEncodingDescription
[Space]%20Space!%21Exclamation
"%22Double quote#%23Hash
$%24Dollar sign%%25Percent
&%26Ampersand'%27Single quote
(%28Left paren)%29Right paren
*%2AAsterisk+%2BPlus
,%2CComma-%2DHyphen
.%2EPeriod/%2FSlash
:%3AColon;%3BSemicolon
<%3CLess than=%3DEquals
>%3EGreater than?%3FQuestion mark
@%40At sign[%5BLeft bracket
\%5CBackslash]%5DRight bracket
^%5ECaret_%5FUnderscore
`%60Backtick{%7BLeft brace
|%7CPipe}%7DRight brace
~%7ETilde

What is URL Encoding?

URL encoding (also known as percent-encoding) is a mechanism for encoding special characters in a URL by replacing them with a % sign followed by two hexadecimal digits. Per RFC 3986, URLs may only contain ASCII letters, digits, and a small set of special characters. All other characters must be encoded before they can be safely transmitted.

Encoding Rules

  • Reserved characters (like /?:@&=+$#,;%) only need encoding in specific contexts
  • Unreserved characters (letters A-Z a-z, digits 0-9, -_.~) are never encoded
  • All other characters (Chinese, spaces, special symbols, etc.) are first converted to UTF-8 bytes, then represented as %HH

Two Encoding Modes

  • encodeURIComponent — Strict encoding. Encodes all non-alphanumeric characters including /?:@&=+$#. Use this for query parameter values, POST form data, and cookie values.
  • encodeURI — Path encoding. Preserves URL structure characters (/?:@&=+$# are not encoded). Use this when encoding a full URL path.

Common Use Cases

  • URL parameters — Passing Chinese or special characters in query strings
  • HTML form submissionapplication/x-www-form-urlencoded format
  • API requests — Encoding RESTful API parameters
  • Redirect URLs — Nesting one URL inside another
Note: Encoding is reversible — encoded data can be decoded back to its original form. URL encoding is not encryption, so never use it to protect sensitive data.
Keyboard shortcuts: Press Ctrl+Enter to convert, Ctrl+Shift+E to switch to encode, Ctrl+Shift+D to switch to decode.

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏