URL Encoder and Decoder

URLs may contain only a limited set of characters. Everything else is percent-encoded: each UTF-8 byte becomes % followed by two hex digits, so a space becomes %20 and é becomes %C3%A9.

Also called: Percent-encoding tool · URL escape tool

  • Last updated
  • Formula tested against reference values

Your numbers

Action

Result

Result
—

Calculating…

Length
—

How to use this calculator

  1. Enter or choose action.
  2. Enter or choose encoding for.
  3. Enter or choose text.
  4. The result updates as you type. Use Copy result or Share to keep it.

Method

Keep A–Z a–z 0–9 - . _ ~; replace every other character by the %XX hex code of each of its UTF-8 bytes.

%XX
a byte value in hexadecimal, e.g. space = %20, & = %26, é = %C3%A9

Worked example

  1. Letters a, b, c, d are unreserved and stay as they are.
  2. Space → %20, & → %26, = → %3D.

"a b&c=d" encodes to a%20b%26c%3Dd, safe to use as a single query value.

What the result means

Encode each query value separately, then join them with & and =. Encoding a whole URL with the component option would also escape the : / ? characters that give the URL its structure.

Assumptions and limits

  • UTF-8 encoding, as specified for URLs by RFC 3986 and the WHATWG URL standard.
  • The whole-URL option leaves reserved characters such as & and = untouched, so it cannot tell a literal & in a value from a separator.

Questions

Should a space be %20 or +?

Both appear. %20 is correct anywhere in a URL; + means space only in form-encoded query strings (application/x-www-form-urlencoded).

Why did decoding fail?

A % must be followed by two hex digits, and the bytes must form valid UTF-8. A stray % in the text should itself be encoded as %25.

Sources