HomeGuides URL Encoding Explained (Percent-Encoding)

URL Encoding Explained (Percent-Encoding)

URLs can only contain a limited set of characters, so anything outside that set — spaces, accents, symbols like & and ? — has to be escaped. That escaping is called URL encoding (or percent-encoding). Here is how it works and when you need it.

What URL encoding does

URL encoding replaces unsafe characters with a percent sign followed by two hexadecimal digits representing the byte. A space becomes %20, an ampersand (&) becomes %26, and a question mark (?) becomes %3F.

This keeps the URL unambiguous: the browser can tell a literal %26 inside a value is data, not the separator between query parameters.

Which characters get encoded

Letters, digits, and a few symbols (- _ . ~) are left alone — they are always safe. Everything else, including spaces and non-English letters, is percent-encoded. Non-ASCII characters are first turned into UTF-8 bytes, then each byte is escaped, which is why an emoji or an accented letter expands into several %xx pairs.

When you need it

  • Putting a search term or email into a query string (?q=...)
  • Passing a full URL as a parameter (a redirect or callback link)
  • Building links by hand that contain spaces or symbols

Encode or decode instantly

Paste text into the URL Encoder to escape it for a link, or the URL Decoder to turn %xx sequences back into readable text. Both run entirely in your browser, nothing is uploaded.

Related tools

Last updated: July 6, 2026