URL Decode Online — decodeURIComponent & decodeURI

Reverse percent-encoding in query strings and URLs. The tool opens in Decode mode. Pick component, full URI, or form-urlencoded scope, then select Convert.

Loading…
URL encoder and decoder
Modern browsers offer encodeURIComponent for isolating parameter keys and values. They offer encodeURI for whole href strings that still need :, ?, #, and other structural characters left intact. FastMinify mirrors both functions so you can reproduce backend behavior while debugging.

Choosing the right encoding mode

The query component scope mirrors encodeURIComponent. Spaces become %20, slashes become %2F, and ampersands become %26. It suits building query pairs in code or reverse-engineering analytics URLs. The full URL scope mirrors encodeURI. Reserved structural characters stay untouched, while Unicode code points still get percent escapes. The form data scope mirrors application/x-www-form-urlencoded. It works like the component scope, but spaces become + instead of %20. Decode applies the inverse transformation with decodeURIComponent or decodeURI. Select Convert to run it, because conversions are not automatic while you type.

Choosing an encoding scope

Query component (encodeURIComponent)
Encodes every reserved character in a single parameter name or value. Spaces become %20, slashes become %2F, ampersands become %26. Use this when building ?key=value pairs for fetch, OAuth scopes, or analytics payloads.
Full URL (encodeURI)
Escapes Unicode and unsafe bytes while keeping the URL structure intact. The characters :, /, ?, #, and & stay literal. Use it to sanitize an almost complete href without mangling its delimiters.
Form data (application/x-www-form-urlencoded)
Encodes like encodeURIComponent but turns spaces into + instead of %20. This mirrors how browsers serialize HTML <form> fields in POST bodies, not how query strings in links are usually built.

Quick comparisons

encodeURIComponent for parameters

Sample input

https://api.example.com/v2/search?q=hello world&filter=a&b&category=home office&price=$100&currency=USD&region=eu-west-1&sort=relevance&page=2&trace=abc123

Sample output

https%3A%2F%2Fapi.example.com%2Fv2%2Fsearch%3Fq%3Dhello%20world%26filter%3Da%26b%26category%3Dhome%20office%26price%3D%24100%26currency%3DUSD%26region%3Deu-west-1%26sort%3Drelevance%26page%3D2%26trace%3Dabc123

encodeURI keeps URL scaffolding

Sample input

https://shop.example.com/catalog?tag=sale%20items&sort=price

Sample output

https://shop.example.com/catalog?tag=sale%2520items&sort=price

Explore neighboring tools

Binary payloads often travel alongside URLs, so use the Base64 encoder for them. Escaping markup before you put strings into templates belongs to the HTML entities utility, and shipping compressed bundles stays easy with CSS minification.

URL encoding FAQ

Solidify percent-encoding behavior before touching APIs

Why does decodeURIComponent throw URI malformed?

decodeURIComponent surfaces errors when percent sequences are incomplete (% alone) or reference invalid UTF-8 bytes.

Should spaces become + or %20?

encodeURIComponent yields %20, the default for REST query strings. Use the Form data scope when you need + for spaces, which matches application/x-www-form-urlencoded bodies from HTML forms.

Does encodeURI protect XSS?

No. Escaping URLs prevents broken delimiters, but it never replaces contextual HTML encoding.

Can I encode entire UTF-8 paths?

Yes. encodeURIComponent encodes everything outside ASCII automatically and preserves surrogate pairs.

Does FastMinify log URLs?

No. There is no server round trip, and everything runs locally.

When should I use decodeURIComponent?

Use it to reverse strings produced by encodeURIComponent, typically query parameter names and values, before you display or re-encode them.

Does the tool handle non-ASCII text?

Yes. UTF-8 sequences are percent-encoded the same way modern browsers do before a request leaves the client.

Can I mix encodeURI and encodeURIComponent?

Usually you pick one strategy per layer: encodeURI for an almost-complete href, encodeURIComponent for each key and value you append to the query string.

Encode or decode Base64, URLs, HTML entities and JWTs, and generate hashes and HMACs in your browser.