Why URLs need encoding
A URL may contain only a limited set of characters: letters, digits and a few symbols. Anything else, including spaces, accented letters, emoji and symbols with special meaning, must be written as a percent sign followed by two hexadecimal digits for each byte of its UTF-8 form. A space becomes %20, an ampersand becomes %26 and the letter é becomes %C3%A9. Without this, a value containing an ampersand would be read as the start of a new parameter and break your link.
Component or full URL?
The two modes match the two standard JavaScript functions. Component mode (encodeURIComponent) escapes everything except letters, digits and the characters - _ . ! ~ * ' ( ). Use it for a single value that goes inside a query string, such as the text of a search or a redirect address. Full URL mode (encodeURI) leaves the characters that give a URL its structure, namely : / ? # & = and a few others, so it encodes an already formed address without breaking it. Applying component mode to a whole URL would turn its slashes and colon into escapes, which is almost never what you want.
Decoding and the plus sign
Decoding reverses the process. In HTML form submissions (the application/x-www-form-urlencoded type), a plus sign stands for a space, whereas in the path part of a URL a plus is just a plus. Tick the option if you are decoding form data or a query string from a form. If the input contains a percent sign that is not followed by two hex digits, or the bytes do not form valid UTF-8, the tool reports an error instead of guessing.
Practical tips
- Encode each parameter value separately and then join them with & and =; do not encode the whole query string at once.
- Do not encode twice. A double-encoded space shows up as %2520.
- Internationalised domain names use a different scheme called Punycode, which this tool does not handle.
Everything is processed in your browser and nothing is sent anywhere.