← All guides

What Is URL Encoding (Percent-Encoding) and When to Use It

URL encoding replaces unsafe characters with a % and two hex digits so they survive inside a URL. Learn what gets encoded, why, and how to decode it.

URL encoding, also called percent-encoding, replaces characters that are unsafe in a URL with a % followed by two hex digits. For example, a space becomes %20 and & becomes %26, so the value cannot break the link's structure.

Why it is needed

URLs may only contain a limited set of characters. Spaces, ?, &, =, # and non-ASCII letters have special meaning or are not allowed, so they must be encoded when they appear inside a query value or path segment.

What gets encoded

  • Reserved characters used as delimiters: ? & = # /
  • Spaces (%20, or + in query strings)
  • Non-ASCII text, encoded as UTF-8 bytes then percent-escaped

Encode or decode now

Paste a URL or a single value into the URL encoder/decoder to convert both ways in your browser. For binary data in text, see What is Base64 encoding.