Skip to content

Developer tools

URL Encoder & Decoder

Percent-encode text for URLs or decode an encoded URL back to readable text. Choose component or whole-URL mode, all in your browser.

Runs on your device — nothing is uploaded

Percent-encode text so it is safe to drop into a URL, or decode an ugly encoded link back into something readable.

How to use this tool

  1. Choose Encode or Decode.
  2. Choose Component or Whole URL (see below — this is the part people get wrong).
  3. Paste your text. The result updates as you type.
  4. Click Copy, or Swap to reverse the operation.

Component vs whole URL

This is the distinction that trips people up, and it maps directly to two different JavaScript functions:

  • Component (encodeURIComponent) also encodes /, ?, &, =, and #. Use it for one value — a single query parameter, a path segment, a form field. If you are building ?q=<value>, the value needs component encoding, or an & inside it will silently split your query string.
  • Whole URL (encodeURI) leaves URL structure characters alone. Use it when you have a complete address with spaces or accents that needs cleaning up, and you want https:// and the ? separators to keep working.

Encoding a whole URL in component mode is the classic mistake — you end up with https%3A%2F%2F..., which is a broken link.

Tips

  • Spaces become %20. In query strings you will also see + used for spaces; both decode to a space, but %20 is safe everywhere.
  • Decoding fails on a lone % that is not followed by two hex digits. If you see an error, look for a stray percent sign.
  • Non-Latin text encodes to several bytes per character, so a short Arabic or Japanese phrase can produce a surprisingly long string. That is normal.

Related tools

FAQ

Does this send my URL anywhere?

No. It calls the browser's built-in encodeURIComponent/decodeURIComponent functions locally. Nothing leaves your device.

Why did my & break the link?

Because & separates parameters. If a value contains & it must be encoded to %26 using Component mode, otherwise everything after it is read as a new parameter.

What characters actually need encoding?

Anything outside the unreserved set: letters, digits, -, ., _, and ~. Everything else — spaces, punctuation, non-Latin characters — should be percent-encoded to be safe across all servers.

Should I use + or %20 for a space?

Use %20. The + convention only applies inside application/x-www-form-urlencoded query strings, and it is interpreted as a literal plus sign in a path.

Can I encode an entire URL including the domain?

Only if you are passing that URL as a value inside another URL — for example a redirect_uri parameter. In that case use Component mode. To merely tidy up a URL you intend to visit, use Whole URL mode.

More developer tools

Try these next