Skip to content

Encode or decode URL components without leaving your browser.

Loading tool

About URL Encoder / Decoder

Percent-encode or decode text for URLs using either encodeURIComponent (for query values and path segments) or encodeURI (for a complete URL, keeping characters like : / ? # & = intact). An option writes spaces as + and treats + as a space when decoding, matching application/x-www-form-urlencoded. Malformed % sequences produce a clear error.

Common uses

  • Encode a query parameter value that contains spaces, &, = or non-ASCII characters.
  • Decode a percent-encoded URL from logs or a redirect to read it.
  • Encode a full URL with accented characters while keeping its structure.
  • Decode form-encoded data where spaces appear as +.

FAQ

What is the difference between encodeURI and encodeURIComponent?
encodeURIComponent encodes everything except letters, digits and - _ . ! ~ * ' ( ), so it is safe for a single query value. encodeURI leaves reserved characters such as / ? # & = unencoded so a full URL keeps working, which means it must not be used for individual parameter values.
Should a space be %20 or +?
%20 is the percent-encoding of a space and is valid anywhere in a URL. + means a space only in application/x-www-form-urlencoded data, such as HTML form submissions and query strings parsed that way.
Why do non-ASCII characters become several % codes?
Characters are first encoded as UTF-8 bytes and each byte is percent-encoded, so é becomes %C3%A9 and many emoji become four % codes.