URL Encode & Decode Online — encodeURIComponent & encodeURI

Escape reserved characters for links and HTTP requests. Switch between strict component encoding (encodeURIComponent) and gentler full-URL encoding (encodeURI). Decode symmetrically for debugging query strings.

Loading…
URL encoder & decoder — query strings vs full URLs
Modern browsers expose encodeURIComponent for isolating parameter keys and values, while encodeURI targets entire href strings that still need :, ?, # and other structural symbols intact. FastMinify mirrors both APIs so you can reproduce backend behaviour during debugging.

Choosing the right encoding mode

Encode component mirrors encodeURIComponent: spaces become %20, slashes become %2F, ampersands become %26. Perfect when you craft query pairs programmatically or reverse-engineer analytics URLs. Encode URI mirrors encodeURI: reserved structural characters remain untouched while Unicode code points still gain percent escapes. Decode performs the inverse transformation using decodeURIComponent or decodeURI respectively.

encodeURIComponent vs encodeURI cheat sheet

Reach for encodeURIComponent when you populate fetch query strings, OAuth scopes, or analytics payloads — anything inside ?key=value pairs. Reserve encodeURI for sanitizing an almost-complete URL without mangling delimiters. When unsure, component mode is the safer default for isolated strings.

Quick comparisons

encodeURIComponent for parameters

Sample input

price=$100 & stock ok?

Sample output

price%3D%24100%20%26%20stock%20ok%3F

encodeURI keeps URL scaffolding

Sample input

https://example.com/path?q=a/b#frag

Sample output

https://example.com/path?q=a/b#frag

Explore neighbouring tools

Binary payloads often ride alongside URLs — use the Base64 encoder. Escaping markup before injecting strings into templates belongs to the HTML entities utility, and shipping compressed bundles stays painless via CSS minification.

URL encoding FAQ

Solidify percent-encoding behaviour before touching APIs

Why does encodeURIComponent 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. Application/x-www-form-urlencoded parsers sometimes translate + to space — standardise on %20 when generating REST payloads.

Does encodeURI protect XSS?

No — escaping URLs prevents delimiter breakage but never substitutes contextual HTML encoding.

Can I encode entire UTF-8 paths?

Yes — encodeURIComponent encodes outside ASCII automatically while preserving surrogate pairs.

Does FastMinify log URLs?

No server round-trip occurs; everything executes locally.

When should I use decodeURIComponent?

Use it to reverse strings produced by encodeURIComponent—typically query parameter names and values—before displaying or re-encoding 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 & escape utilities

URL Encode & Decode Online — encodeURIComponent & encodeURI