About the url encode / decode
Percent-encode text so it is safe to put in a URL, or decode a percent-encoded string back to readable text. Use it for query parameter values, redirect URLs and anything containing spaces, &, = or non-ASCII characters. It uses the standard encodeURIComponent and decodeURIComponent functions.
How to use it
- Choose Encode or Decode.
- Paste your text or encoded string into the input box.
- Click URL Encode or URL Decode.
- Copy the result, or swap to reverse the direction.
Questions
- What is the difference between encodeURI and encodeURIComponent?
- encodeURI leaves characters like /, ?, & and = alone because it expects a whole URL. encodeURIComponent, which this tool uses, encodes them too, which is what you want for a single query value or path segment.
- Why is a space sometimes %20 and sometimes +?
- %20 is standard percent-encoding. + means a space only in HTML form encoding (application/x-www-form-urlencoded). This tool outputs %20 and does not turn + into a space when decoding.
- Should I encode a whole URL?
- Usually not. Encode each parameter value separately, then assemble the URL; encoding the whole thing turns :// and ? into escapes and breaks the link.