URL Encoder & Decoder

Percent-encode text for URLs, or decode it back.

Options

Examples

Questions

What is the difference between encoding a component and a full URL?

Encoding a component escapes &, =, ? and / because they would otherwise be read as URL structure. Use it for one value. Encoding a full URL leaves those alone so the address still works, and only escapes characters like spaces.

Why does a space become %20 sometimes and + other times?

Percent-encoding always gives %20. The + comes from HTML form submissions, a different and older format. Use %20 unless you're building a form body.

Why do I get an "invalid percent-encoding" error?

A % isn't followed by two hex digits, or the escapes don't form valid UTF-8. Often the text was already decoded, or was encoded twice and then partly decoded.

Which characters are never encoded?

The unreserved characters from RFC 3986: A–Z, a–z, 0–9 and - _ . ~. Encoding a component escapes everything else.

What does %2520 mean?

The value was encoded twice: the % from %20 was itself encoded as %25. Decode twice to recover it, and look for the duplicate encoding step in your code.