Encode the URL.
Keep it readable.
Encode query values, encode a complete URI, or decode percent-escaped text locally with the browser's native URL functions.
How do I encode a URL? Paste text or a URL to percent-encode or decode it instantly.
URL encoder and decoder
Use component encoding for individual query values. Full URI encoding keeps URL separators such as :, /, and ? readable where possible.
How to encode or decode a URL
- Choose the mode — component encoding for individual values, full-URI for whole links.
- Paste the text — encoded or plain.
- Copy the result — safe for query strings, redirects, and API calls.
The everyday debugging cases
- A tracking parameter broke because an ampersand inside a value was not encoded
- Reading a URL full of percent signs and guessing wrong
- Passing a redirect target as a query parameter — needs component encoding
Good to know
Component encoding escapes reserved characters inside a single value; full-URI encoding keeps the structural characters (:, /, ?) readable. Double-encoding is the classic bug — encode once, at the point where the value enters the URL. And in form bodies, spaces are + while in paths they are %20.
What is the difference between encodeURI and encodeURIComponent?
encodeURI is intended for a complete URI and preserves structural separators. encodeURIComponent is intended for one value such as a query parameter.
Why did decoding fail?
The input may contain a stray percent sign or an incomplete escape sequence. Copy the encoded value exactly and try again.