URL Encoder & Decoder
Encode query parameters and strings to percent-encoded URI notation, or decode escaped URLs. Fast, secure and browser-based.
RFC 3986 Percent-Encoding Specifications
Uniform Resource Identifiers (URIs) and URLs are constrained by RFC 3986 to a restricted subset of the US-ASCII character set. Characters that are not within this restricted set, or that possess special reserved syntactical meaning in URL structure (such as delimiters /, ?, &, =, #), must be represented via Percent-Encoding (URL encoding).
A percent-encoded character consists of a percent sign (%) followed by a two-character hexadecimal number representing the character's numerical byte value in UTF-8. For example, a space character (ASCII 32, hex 20) becomes %20, and an ampersand becomes %26.
Our URL Encoder & Decoder provides instant bidirectional conversion, supporting both full URI encoding and individual query parameter component encoding.
encodeURI() vs encodeURIComponent() in JavaScript
A critical distinction in web development is choosing between the two native JavaScript URL encoding functions:
encodeURI(): Designed for encoding complete, entire URLs. It leaves protocol and routing delimiters intact (http://,/,?,&,#) while encoding non-ASCII characters and spaces.encodeURIComponent(): Designed for encoding individual parameter keys and values. It encodes ALL reserved characters (including&,=,/, and?). Always useencodeURIComponent()when adding values to query parameters to prevent query injection bugs.
const query = "shoes & socks = cool";
// WRONG: Corrupts query string parameters
const badUrl = "https://example.com/search?q=" + encodeURI(query);
// Result: https://example.com/search?q=shoes%20&%20socks%20=%20cool (& creates new param!)
// CORRECT: Safely escapes parameter delimiters
const goodUrl = "https://example.com/search?q=" + encodeURIComponent(query);
// Result: https://example.com/search?q=shoes%20%26%20socks%20%3D%20cool
Programmatic URL Encoding in Python & CLI
# Python 3 urllib.parse
from urllib.parse import quote, unquote
param = "search term & filter"
encoded = quote(param)
print("Encoded:", encoded) # search%20term%20%26%20filter
print("Decoded:", unquote(encoded))
The Plus (+) vs %20 Space Controversy
In standard RFC 3986 URI paths, a space must strictly be encoded as %20. However, in legacy HTML form submissions (MIME type application/x-www-form-urlencoded), spaces are encoded as plus signs (+). Modern web servers automatically decode both, but %20 is preferred for REST API compliance.
Related Converters & Encoders
Chain URL Encoder & Decoder with these complementary client-side utilities from our Converters & Encoders collection:
Convert plain text to Base64 format or decode Base64 strings to readable text instantly. 100% private, browser-based, and supports UTF-8.
Encode images to Base64 data strings or decode Base64 strings back to images locally. 100% secure and client-side.
Free online Base32 and Base58 encoder/decoder. Encode or decode text and hexadecimal strings offline. Standard RFC 4648 Base32 and Bitcoin Base58 supported.
Free online base converter. Transform numbers between Decimal, Hexadecimal, Binary, Octal, and custom bases (2 to 36) with arbitrary precision. 100% private and local.
Frequently Asked Questions
URLs are transmitted across heterogeneous network hardware that only reliably forwards a limited set of ASCII characters. Percent-encoding allows arbitrary characters, spaces, and international alphabets to travel safely without corruption.
Yes. Our decoder parses UTF-8 byte sequences correctly, restoring international characters seamlessly.
Query injection occurs when untrusted user input containing unescaped "&" or "=" characters is appended directly to a URL, altering the parameters and logic received by the backend server.
When using the "Component" mode, all reserved characters including the hash fragment (#) are safely encoded as %23.
No. All encoding and decoding run 100% locally in your web browser.