What this tool does
Percent-encodes and decodes strings for use in URLs. It supports both component-mode (encode every reserved character so the value is safe inside a query parameter or path segment) and full-URL mode (preserve the structure of https://host/path?query while encoding only the parts that need it).
When you'd use it
- Building a query string by hand and needing to escape spaces, ampersands, and equals signs.
- Decoding a redirect URL that came back wrapped in
%2Fand%3D. - Comparing the encoded form of a URL against an allow-list.
- Producing a clean shareable link from a string with non-ASCII characters.
How it works
Component encoding uses encodeURIComponent, which percent-encodes every character that isn't an unreserved one (A-Z a-z 0-9 - _ . ! ~ * ' ( )). Full-URL encoding uses encodeURI, which leaves reserved structural characters (: / ? # [ ] @) alone. Decoding uses the inverse functions, with malformed sequences flagged as errors instead of silently dropped.
Notes
Why does + decode to a space sometimes? That's the older application/x-www-form-urlencoded convention used in form submissions, not standard URL encoding. RFC 3986 leaves + alone. Most decoders only treat + as space inside the query string, never the path.
Should I use this on the whole URL or just one part? Encode parts. If you encode a full URL with component-mode, you'll break the :// and the path slashes. Build the URL out of pre-encoded pieces, or use full-URL mode.
Does this handle Unicode? Yes. UTF-8 first, then percent-encoding on each byte. café becomes caf%C3%A9.
Related tools
- Base64 — different escape mechanism for binary-in-text
- JSON Formatter — for body payloads instead of query strings