URL Encoder / Decoder
Encode or decode URLs and URL components using encodeURIComponent,
encodeURI, or
decodeURIComponent.
Runs entirely in your browser — your data never leaves your device.
encodeURIComponent — encodes everything except A–Z a–z 0–9 - _ . ! ~ * ' ( ). Use for individual query parameter values.
Component vs full URL
encodeURIComponent encodes everything except unreserved characters (A–Z, a–z, 0–9, -, _, ., !, ~, *, ', (, )). Use it for individual query parameter values — e.g. the value of a search query. encodeURI is less aggressive and leaves URL structural characters (://?#[]@&=+) intact. Use it when encoding a complete URL.
When encoding is required
URLs can only contain a limited set of ASCII characters. Spaces, non-ASCII characters, and reserved characters in the wrong position must be percent-encoded. This matters in: query strings passed to APIs, redirect URLs in OAuth flows, path segments containing special characters, and HTTP headers that carry URL values.
Decoding errors
decodeURIComponent throws a URIError when it encounters a malformed percent sequence — e.g. %GG (invalid hex), a lone % at end of string, or %20 followed by nothing. This tool catches and displays the error as plain text. If you see an error decoding a full URL, the URL may have been encoded with encodeURI — try copying just the query parameter value instead.