URL encoder and decoder
Percent-encode text for use in URLs, decode it back, and break a query string into readable parameters.
tool 06 of 12 []
all shortcuts ?
How to use it
- Pick a mode. Component encodes everything except letters, digits and - _ . ! ~ * ' ( ), which is right for a single query value or path segment.
- Full URL mode leaves the characters that structure a URL (: / ? # & =) alone, so use it only for a whole address that is already assembled.
- Form mode behaves like Component but writes spaces as +, the convention of application/x-www-form-urlencoded bodies and many query strings.
- Use Parse to split a URL or query string into decoded key and value pairs.
Examples
Select an example to load it into the tool.
- Text with spaces and &
café & tea = 5% off? - Encoded value to decode
caf%C3%A9%20%26%20tea%20%3D%205%25%20off%3F - URL to parse
https://example.com/search?q=caf%C3%A9+tea&page=2&tag=a&tag=b#top
Frequently asked questions
encodeURI or encodeURIComponent?
Use encodeURIComponent (Component mode) for any piece you insert into a URL, such as a query value. encodeURI is only for an entire URL, and it does not escape & = ? #, so it would let a value break out of its parameter.
Should a space be %20 or +?
In a URL path, always %20. In a query string, + for a space is a long-standing form convention, but %20 is understood everywhere. When decoding, use Form mode only if the data really is form-encoded, since a literal + in Component mode stays a plus.
Why does decoding say malformed?
A % must be followed by two hex digits, and multi-byte characters such as an accented e need their whole UTF-8 sequence (%C3%A9). A lone % or a cut-off sequence is an error.
Is anything sent to a server?
No, it all runs in your browser using the standard encodeURIComponent and decodeURIComponent functions.
How are repeated parameters shown?
Each occurrence is listed separately in order, for example tag=a and tag=b, so you can see exactly what a server would receive.