Z

What is URL encoding?

URL encoding, or percent-encoding, replaces characters that are unsafe or reserved in a URL with a percent sign followed by two hexadecimal digits (e.g. a space becomes %20). It lets arbitrary text — spaces, symbols, non-ASCII characters — be safely included in URLs and query strings.

URLs may only contain a limited set of characters. Anything else — spaces, &, ?, / when used as data, or accented letters — is encoded as %XX where XX is the byte's hex value (UTF-8). For example café becomes caf%C3%A9.

It is essential for building query strings and form submissions so that reserved characters in your data are not misread as URL structure.

URL encoding tools

Frequently asked questions

Why is a space encoded as %20?

Spaces are not allowed in URLs, so they are percent-encoded. 0x20 is the byte value of a space, hence %20 (in query strings it may also appear as +).

Is URL encoding the same as Base64?

No. URL encoding escapes unsafe characters in text; Base64 turns binary into text. They solve different problems.