AIAPIDate & TimeImageJSONMathNext.jsSecuritySEOTextDesignDatabase
All ToolsWorkspacesWorkflowsLearnError EncyclopediaAboutPrivacyTermsContactEmail

© 2026 Web Util Slyce. All tools run client-side — your data stays private.

Back to Learn

What is URL Encoding? — Percent Encoding Explained

URL encoding (also called percent encoding) converts characters in URLs into a format that can be transmitted safely over the internet. Reserved characters, unsafe characters, and non-ASCII characters are replaced with a % followed by two hexadecimal digits.

What Is It?

URLs can only contain a limited set of ASCII characters. URL encoding replaces unsafe characters with a percent sign followed by their two-digit hex code. For example, a space becomes %20, and a forward slash becomes %2F. The encodeURIComponent() and encodeURI() functions in JavaScript handle this automatically.

How It Works

Characters are classified as unreserved (A-Z, a-z, 0-9, -, _, ., ~) or reserved (!, #, $, %, &, ', (, ), *, +, ,, /, :, ;, =, ?, @, [, ]). Reserved characters must be encoded if they appear in a context where they would have special meaning. Non-ASCII characters are first encoded as UTF-8 bytes, then each byte is percent-encoded.

Key Characteristics

  • Converts unsafe characters to %XX format using hexadecimal byte values
  • Reserved characters are encoded in specific URL parts (query, path, fragment)
  • Spaces become %20 (not +, though form data uses + historically)
  • UTF-8 encoding is used for non-ASCII characters (Chinese, Arabic, emoji)
  • encodeURIComponent vs encodeURI differ in which characters they encode

Common Use Cases

  • Encoding query string parameters with special characters
  • Submitting form data with spaces, symbols, or non-ASCII text
  • Encoding URLs within URLs (nested URL parameters)
  • Building safe file download URLs with international filenames
  • Creating links with special characters in path segments

Free Online Tools

URL Encode/Decode URL Encoding Guide HTML Entity Encoder

Frequently Asked Questions

Why does a space become %20?

Spaces are not allowed in URLs. %20 is the hex encoding of the space character's ASCII value (20 in hex, 32 in decimal).

What is the difference between %20 and +?

In query strings, + historically represents a space (application/x-www-form-urlencoded). %20 is the standard percent-encoding for spaces. Modern URLs should use %20.

Does every language URL-encode the same way?

Most languages follow RFC 3986 standards. The main difference is which characters are considered safe — some tools encode more or fewer characters by default.