URL encode and decode

Percent-encode text for URLs and query strings, or decode it back.

Component vs full URL

  • Component (encodeURIComponent) encodes everything except letters, digits and - _ . ! ~ * ' ( ). Use it for a single query value or path segment.
  • Full URL (encodeURI) leaves characters that structure a URL, like : / ? # & =, alone. Use it for a whole address that contains spaces or non-English characters.

Spaces: %20 or +?

In URLs, a space is %20. In HTML form data (application/x-www-form-urlencoded), a space is sent as +. When decoding, tick Treat + as space for form-style data.

Everything runs in your browser. Nothing you paste is uploaded, logged or stored on a server, so it's safe to use with private data.

Questions

What does %20 mean?

It's a percent-encoded space: 20 is the hexadecimal code for the space character.

Why is my URL encoded twice?

Encoding an already-encoded string turns % into %25, so %20 becomes %2520. Decode once to fix it.

Related tools