URL Encode / Decode

Percent-encode text for safe use in a URL, or decode it back.

Equation used
Percent-encoding: reserved/unsafe bytes → %XX (hex), per RFC 3986

Frequently Asked Questions

Which characters get percent-encoded?

Reserved and unsafe characters for URLs — spaces, &, =, ?, #, /, and non-ASCII characters among others — are converted to a % followed by their byte value in hex (e.g. a space becomes %20). Letters, digits, and a small set of unreserved punctuation are left as-is.

Why would decoding fail with an error?

Decoding expects well-formed %XX sequences (two valid hex digits after each %). A stray % not followed by two hex digits, or a cut-off sequence, isn't valid percent-encoding and causes the error message instead of a result.

Is this the same as encoding a full URL vs. just a parameter?

This tool encodes/decodes a string the way you'd prepare a single query-parameter value (using encodeURIComponent), which escapes more characters — including / and & — than encoding a whole URL would, since those characters are meaningful in a full URL.