What this tool does
URLs only allow a small set of characters. Encoding turns the rest into %XX escapes; the subtle part is whether you are encoding a whole URL or a single parameter value. Component mode encodes separators such as & and =, while full-URI mode leaves the URL structure intact.
How to use it
- Choose encode or decode.
- Pick component mode for a parameter, full URI for a complete URL.
- Copy the result.
Questions
encodeURIComponent or encodeURI?
Use encodeURIComponent for each parameter value. Use encodeURI for a complete URL, because it keeps :, /, ? and & intact.
Why does + become %20?
+ is a form-encoding convention. Percent-encoding represents a space as %20.
What happens with malformed input?
Decoding reports an error instead of silently producing an incorrect string.