URL Encoder / Decoder
Percent-encode or decode URLs and URL components. Handles UTF-8 correctly. Choose Component mode
(encodes / and ?) for query values and path segments, or Full URL mode for
entire URLs.
What URL encoding actually does
URL encoding (percent-encoding, RFC 3986) replaces characters that have special meaning in URLs —
or are unsafe to transmit — with a %XX sequence where XX is the byte's hex value. The
unreserved characters (A-Z a-z 0-9 - . _ ~) pass through unencoded. Everything else,
encoded as its UTF-8 bytes, gets percent-escaped.
Where this matters: query string values where users might paste arbitrary text including
& or =, path segments containing slashes that aren't path separators,
fragments containing #. Forgetting to encode is one of the most common API integration
bugs.
Frequently asked questions
What's the difference between encodeURI and encodeURIComponent?
encodeURI assumes the input is a full URL and leaves reserved characters (:, /, ?, #, etc.) alone. encodeURIComponent encodes those too because it assumes the input is one component (a query value, a path segment) that needs to be safe to drop into any URL position. Use Component mode for query parameter values; use Full URL mode for entire URLs.Does this handle Unicode correctly?
café becomes caf%C3%A9 — three bytes for é in UTF-8 → two percent-escapes.Why is <code>%20</code> sometimes <code>+</code>?
+ (a legacy of form encoding, application/x-www-form-urlencoded). In path segments and elsewhere, spaces are %20. The "Form encoding" toggle switches the space behavior; everything else encodes the same way.