URL Encoding Explained — A Practical Guide

Learn what percent-encoding is, why URLs use it, and how to encode and decode URLs online.

URLs can only contain a limited set of characters. The rest — spaces, slashes, accented letters, emoji — must be encoded. This guide explains percent-encoding and shows how to use it.

1. What is URL encoding?

URL encoding (also called percent-encoding) replaces unsafe or reserved characters in a URL with a % followed by two hex digits. A space becomes %20, an ampersand becomes %26, and so on.

2. Which characters are encoded?

  • Reserved characters like ?, #, &, = — encoded when used in a value, not a separator
  • Unsafe characters like spaces, quotes, brackets — must always be encoded
  • Non-ASCII characters like é or emoji — encoded as UTF-8 bytes then percent-encoded

3. How to encode URLs

Open the URL Encoder / Decoder, paste any string, and click Encode. The tool returns the percent-encoded version. Click Decode to reverse the process.

4. Common use cases

  • Query parameters — values with spaces or special characters must be encoded
  • Form submissions — application/x-www-form-urlencoded uses URL encoding
  • API requests — most APIs accept percent-encoded strings
  • Link sharing — share a URL with spaces safely by encoding first
Advertisement