URL Encoder and Decoder

Percent-encode a URL or a single query value, with the component and full-URI rules kept apart.

Which rules?
Result

URL breakdown

Scheme

https

Host

example.com

Path

/search

Query parameters, decoded

qproject plan
budget
langen

How it works

  1. 1Paste a URL or a fragment of one and it converts as you type.
  2. 2Choose whether you are encoding a single value or a whole URL — the two use different rules and picking the wrong one is the usual cause of a broken link.
  3. 3Anything that parses as a complete URL is also broken down into its parts, with the query parameters decoded for you.
  4. 4Decoding reports a malformed escape rather than silently mangling the text.

Common questions

What is the difference between the two modes?
encodeURIComponent escapes the delimiters — & = ? / : # — because inside a single value those characters would end the value early. encodeURI leaves them alone because in a whole URL they are structure. Encoding a full URL with the component rules gives you https%3A%2F%2F..., which is almost never what you want.
Why did my query value break when it contained an ampersand?
Because an unencoded & ends the parameter. A value of "budget & scope" has to become "budget%20%26%20scope" or the server sees two parameters. That is exactly the case the component mode handles.
Why is a space sometimes %20 and sometimes +?
Both appear. %20 is correct percent-encoding and works anywhere in a URL. The + convention comes from HTML form submission and is only valid in a query string. This tool always produces %20, which is safe in both places.
Does it handle non-English characters?
Yes. They are converted to UTF-8 bytes and each byte is percent-encoded, which is what the standard requires. That is why one accented character becomes two escape sequences.
Why does decoding sometimes fail?
A percent sign has to be followed by two hex digits. A bare % — common in text like "100% done" — is not a valid escape, so the decoder stops rather than guessing.

Encoding binary rather than text?

Percent-encoding is for URLs. To carry a file or arbitrary bytes through something that only accepts text, Base64 is the right encoding.

Open the Base64 converter

Related tools