Percent-Encoding
Percent-encoding is the mechanism that converts unsafe characters in URLs into %HH form, defined by RFC 3986.
Purpose
It lets arbitrary bytes appear safely in URL components while preserving the semantics of URL structural characters (/ ? # = &).
Mechanism
Each byte of an unsafe character becomes % followed by two uppercase hexadecimal digits. The reserved set depends on the component: paths allow / and queries allow ? = &. Unreserved characters (A-Z a-z 0-9 - _ . ~) are never encoded.
Use cases
- URL query parameter encoding
- RESTful path parameters
- OAuth signature base string construction
- S3 URL path encoding
Examples
- Input
hello worldOutputhello%20worldA space encodes as %20
Common errors
- Double encoding (an already-encoded % gets encoded again as %25)
- Encode the raw value exactly once
Related terms
URL Encoding
URL encoding (percent-encoding) converts characters not allowed in URLs into %HH form, so arbitrary data can appear safely in URL components. 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
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
Pct Encode
Pct Encode — pure client-side tool. Privacy-first, no server round-trip. TOOL
Pct Decode
Pct Decode — pure client-side tool. Privacy-first, no server round-trip. TOOL