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

Encoded

How to use the URL Encode / Decode

  1. Choose Encode or Decode.
  2. 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.
  3. Paste your text. The result appears instantly; malformed escapes are reported with their position.
  4. 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

FunctionLeaves aloneUse for
encodeURIComponentA-Z a-z 0-9 - _ . ~A single query value, path segment or parameter name
encodeURIAlso : / ? # [ ] @ ! $ & ' ( ) * + , ; =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?
A % 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?
The bytes were not encoded as UTF-8, often because the text was produced by a legacy system using Latin-1 (for example %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?
Encode each parameter name and value separately with component encoding, then join them with = and &. Encoding a complete URL with component mode would also escape :// and break it.
Is double encoding a problem?
Yes. Encoding an already-encoded string turns %20 into %2520. If you see %25 followed by hex digits, the value was probably encoded twice. Decode it twice to recover the original.

Related tools