URL Encoding
URL encoding (percent-encoding) converts characters not allowed in URLs into %HH form, so arbitrary data can appear safely in URL components.
Purpose
It keeps reserved characters (such as /, ?, #, =) and non-ASCII characters from breaking URL structure, while remaining reversibly round-trippable.
Mechanism
Unsafe characters are converted byte-by-byte into % followed by two uppercase hexadecimal digits. RFC 3986 defines the reserved character sets; the HTML5 application/x-www-form-urlencoded form additionally encodes a space as +. Modern browsers and the fetch API handle this automatically.
Use cases
- Passing non-ASCII text and special characters in URL query parameters
- RESTful API path parameter encoding
- OAuth callback URL encoding
- Subject and body in mailto links
Examples
- Input
a b&cOutputa%20b%26cRFC 3986 form; the form-encoded variant is a+b%26c
Common errors
- Encoding the entire URL instead of just the parameter values
- Encode parameter values only and keep the /?=& delimiters
Related terms
Percent-Encoding
Percent-encoding is the mechanism that converts unsafe characters in URLs into %HH form, defined by RFC 3986. GLOSSARY
Form Encoding
Form encoding (application/x-www-form-urlencoded) is how HTML forms encode key-value pairs on submission, encoding spaces as + instead of %20. GLOSSARY
HTML Entities
HTML entities escape characters with special meaning in HTML (<, >, &, ") into &name; or &#NNN; form so they display literally instead of being parsed as markup. GLOSSARY
URL
A URL (Uniform Resource Locator) is a string identifying the location of an Internet resource, comprising scheme, host, port, path, query, and fragment. GLOSSARY
Related tools
URL Encoder
Percent-encode text for safe use in URLs. Free, private, and 100% client-side. TOOL
URL Decoder
Decode percent-encoded URL text back to readable characters. Free, private, and 100% client-side. TOOL
URL Parser
Parse a URL into its components: protocol, host, path, query, hash, port, username, and password. Free, private, and 100% client-side. TOOL
Url Encode Form
Url Encode Form — pure client-side tool. Privacy-first, no server round-trip. TOOL
Url Decode Form
Url Decode Form — pure client-side tool. Privacy-first, no server round-trip. TOOL
Url Decode Component
Url Decode Component — pure client-side tool. Privacy-first, no server round-trip. TOOL