URL codec
URL Encoder & Decoder
Convert spaces, Unicode, and reserved characters to percent-encoding, or restore encoded query values to readable text.
Encodes query values; it does not test whether a URL is reachable
Input
Ready to encode
encodeURIComponent is for query values; usually do not encode an entire URL with its protocol and slashes.
Result
Copyable text
https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Donline%20tools
How it works
Encode parameter values, not usually the entire URL.
encodeURIComponent encodes Unicode, spaces, and most reserved characters, making it suitable for one query parameter value. Encoding protocol colons, path slashes, and query separators together breaks URL structure.
A percent sign is followed by a two-digit hexadecimal byte. UTF-8 Unicode may produce several consecutive %XX bytes. Decoding requires complete, valid percent sequences.
Example: space → %20; “search” stays search because ASCII letters need no encoding.
FAQ
URL Encoder & Decoder · FAQ
Why are spaces sometimes + and sometimes %20?
URL percent-encoding uses %20. HTML forms using application/x-www-form-urlencoded commonly represent spaces as +.
Should I encode a whole URL?
Usually encode only a path segment or query value. Encoding the whole string also changes the protocol, slashes, and separators.
Does URL encoding protect privacy?
No. It is only a transport representation and anyone can decode it. Keep sensitive data out of URL query parameters.