URL Encode / Decode

Encode text for safe use in a URL query string, or decode a percent-encoded string. Runs entirely in your browser.

How it works

Percent-encoding replaces characters that aren't safe in a URL (spaces, ?, &, =, non-ASCII characters, ...) with a % followed by their hex byte value. This uses encodeURIComponent/ decodeURIComponent, the correct choice for individual query parameter values (as opposed to encodeURI, which is meant for whole URLs).

Examples

InputEncoded
hello world?hello%20world%3F
a&b=ca%26b%3Dc

FAQ

What happens with a malformed input while decoding? (e.g. a stray % not followed by two hex digits) You'll see a clear error message instead of a silent failure or a browser exception.