What is URL encoding?
URL encoding (officially percent-encoding, defined in RFC 3986) converts characters that are unsafe or reserved in URLs into a % followed by two hexadecimal digits. A space becomes %20, & becomes %26, = becomes %3D, and ? becomes %3F. This ensures URLs remain structurally valid when they contain special characters in query parameters, path segments, or fragment identifiers. All characters except unreserved characters (letters, digits, -, _, ., ~) must be percent-encoded in standard URLs.
URL encoding is critical when constructing API requests, parsing query strings, building redirect URLs, and handling user-submitted content in web applications. A common bug is embedding raw special characters in URLs: an & inside a query parameter value gets parsed as a parameter separator, breaking the URL structure. Search queries, tokens, file names with spaces, and any user-generated text must be properly encoded before being placed in a URL. URL decoding is equally useful when reading encoded values from log files or API responses.
This tool uses the RFC 3986-compliant encodeURIComponent / decodeURIComponent functions, which encode all characters except A–Z, a–z, 0–9, -, _, ., and ~. Note: encodeURIComponent also encodes forward slashes (/), so it is designed for encoding individual query parameter values, not entire URLs. To encode a complete URL while preserving its structure, use encodeURI instead — which preserves structural characters like :, /, ?, and #. All processing runs locally in your browser.
Frequently Asked Questions
- What is URL encoding?
- URL encoding (percent-encoding) converts unsafe characters into a % followed by two hexadecimal digits. For example, a space becomes %20, & becomes %26, and = becomes %3D, keeping URLs structurally valid.
- Why do I need to URL-encode a value?
- URLs only allow a limited set of characters. If a query parameter contains &, =, ?, #, or spaces, those characters must be encoded before being placed in a URL — otherwise they break the URL structure and corrupt the data.
- How do I decode a percent-encoded URL?
- Paste the encoded URL or value into the input field and select Decode. The tool converts all %XX sequences back to their original readable characters.
- What characters are encoded by this tool?
- All characters except letters (A–Z, a–z), digits (0–9), hyphen (-), underscore (_), period (.), and tilde (~) are encoded. These are the unreserved characters defined in RFC 3986 that are always safe in URLs.
- What is the difference between %20 and + for spaces?
- %20 is the standard percent-encoding for a space (RFC 3986). The + sign represents a space only in application/x-www-form-urlencoded format (HTML form submissions). In modern URLs and APIs, %20 is preferred and unambiguous.
- How do I encode a URL query parameter value?
- Encode only the parameter value, not the entire URL. For example, if your value is "hello world", encode it to "hello%20world" and append it to the URL. Encoding the full URL would also encode the :// and structural slashes.
- What does %3D mean in a URL?
- %3D is the percent-encoded form of the = character. Since = separates parameter names from values in query strings (key=value), any = that appears inside a parameter value must be encoded as %3D to avoid ambiguity.