URL encode and decode

Paste text to percent-encode it for a URL, or paste an encoded string to decode it. Pick "component" for a single query value and "full URL" for a whole address.

runs in your browser · nothing uploaded

loading tool…

How to use it

  1. Choose Encode or Decode.
  2. Choose Component (for one query value or path segment) or Full URL (keeps : / ? & = # intact).
  3. Paste your input. The output updates as you type.
  4. Tick "Spaces as +" if the value goes into an HTML form-style query string.

Component or full URL?

Component encoding (encodeURIComponent in JavaScript) escapes everything except letters, digits and - _ . ! ~ * ' ( ). Use it for a single value you are putting into a query string, such as a search term or a redirect URL. If you used full-URL encoding there, an & inside the value would split it into two parameters.

Full-URL encoding (encodeURI) leaves the characters that give a URL its structure alone, so a complete address stays a working address. Use it only on a whole URL.

%20 or +?

In a URL path, a space is always %20. In a query string sent by an HTML form (application/x-www-form-urlencoded), a space is written as +. Decoding with "Spaces as +" ticked turns + back into a space; leave it off for paths, where + is a literal plus.

Questions

Is what I paste sent to a server?

No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is uploaded, logged or stored by us, so it is safe to use with real data.

Why does decoding fail with "URI malformed"?

There is a % that is not followed by two hex digits, or the escaped bytes are not valid UTF-8. A literal % in text must itself be encoded as %25.

Does it handle non-English text?

Yes. Characters are encoded as their UTF-8 bytes, so "café" becomes caf%C3%A9, which every modern server expects.