How it works
We call the browser's encodeURIComponent / encodeURI(or the matching decode functions) directly. No network call.
FAQ
When do I use encodeURIComponent vs encodeURI? encodeURIComponent for a value that goes inside a URL (a query parameter, a path segment) — it escapes everything that isn't safe. encodeURI for a complete URL where you want to keep structural characters like : / ? # & = intact while still escaping spaces and unicode.
Why is + showing up as space when I decode? Some implementations use + for space in form-encoded data (application/x-www-form-urlencoded), while URL percent-encoding strictly uses %20. The decoder here implements the URL standard, which leaves + alone. If you have form-style input, replace + with %20 first.
Is anything sent to a server? No. These are pure browser primitives (encodeURIComponent, encodeURI). No network call.