How it works
A URL can only safely contain a limited set of characters. Percent-encoding
replaces everything else with % followed by two hex digits — a space
becomes %20, & becomes %26, and so on. This tool wraps the browser’s
own encodeURIComponent and decodeURIComponent, so it matches exactly
what JavaScript does when building a request.
Encoding a component, not a whole URL
This encodes one piece of a URL — a query parameter’s value, a path
segment — not an entire address. Structural characters such as /, :,
?, and & are left alone only when they are separating parts of the URL
itself; inside a component’s value, they get encoded like anything else.
Running a full URL through this tool would encode the :// and / you
wanted to keep.
When you would need this
Building a link by hand where a value might contain spaces, &, or
non-ASCII characters; reading a raw query string a server logged; or
checking exactly what a link decodes to before you click it.