Published: May 18, 2026
URL encoding (also called percent-encoding) is a fundamental concept every web developer needs to understand. If you've ever seen %20 in a URL, you've encountered URL encoding in action. This guide explains what URL encoding is, why it's necessary, and how to use a free URL encoder/decoder to handle special characters in your URLs.
URL encoding converts characters that are not allowed in a URL into a format that can be safely transmitted over the internet. It replaces unsafe ASCII characters with a % sign followed by two hexadecimal digits representing the character's ASCII code. For example, a space becomes %20, and a forward slash becomes %2F.
The official specification, defined in RFC 3986, ensures that URLs are universally understood by browsers, servers, and APIs regardless of the characters they contain.
URLs have a restricted character set. Certain characters have special meanings in the URL syntax:
/ separates path segments? starts the query string# starts a fragment identifier& separates query parameters= separates parameter names and valuesIf your data contains these characters, they must be encoded so they aren't misinterpreted as URL syntax. Non-ASCII characters (like Unicode, Chinese, Japanese, or accented characters) must also be encoded because URLs only support ASCII.
There are three categories of characters in URLs:
These have special meanings and must be encoded if used as data: :, /, ?, #, [, ], @, !, $, &, ', (, ), *, +, ,, ;, =
These have no special meaning but may cause issues: space (%20), double quote (%22), < (%3C), > (%3E), \ (%5C), ^ (%5E), backtick (%60), { (%7B), } (%7D), | (%7C)
Any character above U+007F must be encoded. For example, the Chinese character δΈζ becomes %E4%B8%AD%E6%96%87 in UTF-8 percent-encoding.
There's an important distinction between encoding a full URL and encoding just one component. JavaScript provides two functions:
encodeURI() β encodes a full URI, preserving characters that are valid in a URL (does not encode :/?#[]@!$&'()*+,;=)encodeURIComponent() β encodes a query parameter value, encoding all special characters including /, ?, &, =Using encodeURIComponent() for query parameters is essential β forgetting to encode values is a common source of broken URLs.
| Character | Encoded | Usage |
|---|---|---|
| Space | %20 | Form data, search queries |
| & | %26 | Ampersand in parameter values |
| = | %3D | Equals sign in parameter values |
| # | %23 | Hash in parameter values |
| + | %2B | Plus sign (not space encoding) |
Use the URL encoder/decoder at Wang Toolbox for instant encoding and decoding. Simply paste your text, click "Encode" or "Decode", and the result appears immediately. The tool runs entirely in your browser β your data never touches a server. It also supports "component mode" for encoding query parameter values where slashes and colons should also be encoded.
Most programming languages provide URL encoding functions:
encodeURIComponent() / decodeURIComponent()urllib.parse.quote() / urllib.parse.unquote()urlencode() / urldecode()URLEncoder.encode() / URLDecoder.decode()url.QueryEscape() / url.QueryUnescape()%20 becomes %2520. Always check before encoding.+ may represent a space (application/x-www-form-urlencoded). In other URL parts, only %20 is valid.Try our free URL encoder/decoder tool today. Also check out the HTML encoder and Base64 encoder/decoder for more encoding needs.