URL Encoder & Decoder
Percent-encode text for URLs and query strings, decode encoded URLs, and break any URL into its parts with decoded query parameters.
Runs in your browserNo sign-upNothing uploaded
Components
Query parameters
How to use the URL Encode / Decode
- Choose Encode or Decode.
- When encoding, pick Component for a single query value or path segment, Full URL to keep the URL structure, or Form data for
application/x-www-form-urlencoded. - Paste your text. The result appears instantly; malformed escapes are reported with their position.
- Paste a complete URL into the URL parser to see its host, path, fragment and every query parameter decoded.
What is URL encoding?
URLs may only contain a limited set of ASCII characters (RFC 3986). Everything else, including spaces, non-English letters and characters that have a special meaning such as &, ? and #, is written as a percent sign followed by two hex digits for each UTF-8 byte. A space becomes %20 and é becomes %C3%A9.
encodeURIComponent vs. encodeURI
| Function | Leaves alone | Use for |
|---|---|---|
encodeURIComponent | A-Z a-z 0-9 - _ . ~ | A single query value, path segment or parameter name |
encodeURI | Also : / ? # [ ] @ ! $ & ' ( ) * + , ; = | A whole URL whose structure must survive |
Using encodeURI on a query value is a classic bug: an & inside the value is not escaped, so it splits the parameter in two. This tool's Component mode also escapes ! ' ( ) * for strict RFC 3986 compliance.
%20 or + for spaces?
In paths, a space must be %20. In HTML form submissions (application/x-www-form-urlencoded) and many query strings, a space is written as +. When decoding, enable Treat + as space for form data, and disable it when a literal plus sign matters, such as in jane+test@example.com.
Frequently asked questions
Why do I get “Malformed escape” when decoding?
% must be followed by exactly two hex digits. A literal percent sign, as in “50% off”, should have been encoded as %25. The error shows the position of the bad sequence.What does “Invalid UTF-8 byte sequence” mean?
%E9 for é instead of %C3%A9), or the string was cut in the middle of a character.Should I encode the whole URL or just the parameters?
= and &. Encoding a complete URL with component mode would also escape :// and break it.Is double encoding a problem?
%20 into %2520. If you see %25 followed by hex digits, the value was probably encoded twice. Decode it twice to recover the original.