URL Encoder & Decoder
URL breakdown
If the input is a URL, its parts are listed here, with the query parameters decoded.
About this tool
URL encoding (percent-encoding) replaces characters that are not allowed in a URL with % followed by two hex digits
of each UTF-8 byte, so café becomes caf%C3%A9. Use it to put values into query strings, build links by hand, or read a URL that is full of % codes.
Everything runs in your browser. Nothing you enter is sent to a server.
How it works
- Component (
encodeURIComponent) encodes everything except letters, digits and- _ . ! ~ * ' ( ). Use it for a single value, such as the text afterq=. If you paste a whole URL, the:/?&=are encoded too. - Full URL (
encodeURI) keeps: / ? # & = + @ $ , ;so a complete URL stays usable. It does not protect an&or#inside a value. - Form data is the style used by HTML forms (
application/x-www-form-urlencoded): like Component, but a space becomes+and! ' ( ) ~are encoded as well, the way browsers submit forms. Decoding in this style turns+back into a space. - Decoding in the other two styles leaves
+as it is, because in a URL path a plus sign is just a plus sign. - Text is always encoded as UTF-8. Old Japanese or Chinese sites that use Shift_JIS, EUC-JP or GBK produce different codes, and decoding them here fails or shows wrong characters.
- Decoding stops with an error if a
%is not followed by two hex digits, or if the bytes are not valid UTF-8.
FAQ
Q. Why do I see %2520?
A. The text was encoded twice. %20 (a space) had its % encoded again as %25. Decode once more to get back to a normal string.
Q. Which style should I use for an API query string?
A. Encode each value with Component, then join the pieces with & and = yourself. Most servers accept both %20 and + for a space in a query string; %20 is also valid in a path.