RFC 3986 URI Percent-Encoding Standards
Uniform Resource Identifier (URI) percent-encoding, formalized in IETF RFC 3986, represents arbitrary octets and non-ASCII Unicode characters using printable ASCII character sequences (a percent sign % followed by two hexadecimal digits representing the byte value).
Reserved vs. Unreserved Characters
- Unreserved Characters (Never Encoded): Uppercase/lowercase alphanumeric letters (
A-Z,a-z), decimal digits (0-9), hyphen (-), underscore (_), period (.), and tilde (~). - Reserved Characters (Delimiters): Characters with syntax meaning in URL structures:
:,/,?,#,[,],@,!,$,&,',(,),*,+,,,;,=.
encodeURI() vs. encodeURIComponent()
encodeURI(): Intended for complete URLs. Preserves protocol schemes, slashes, question marks, and colons (e.g. leaves https://example.com/path?query=1 structurally intact).
encodeURIComponent(): Intended for individual query parameter keys and values. Encodes all reserved characters including /, ?, &, and = to prevent query string breaking.
Web & SEO Tool Synergy
Clean URL encoding prevents tracking degradation and broken redirects:
- Campaign Tagging: Build clean query URLs with our UTM Campaign Builder.
- Slug Formatting: Convert titles to URL-safe paths with our URL Slug Generator.
- Redirect Integrity: Verify that server routing preserves percent-encoded characters using our Redirect Chain Checker.
Frequently Asked Questions
What is the difference between %20 and + in URL encoding?
%20 is the standard RFC 3986 percent-encoding for a space character across all URL segments. + is an alternate encoding for space historically used only inside application/x-www-form-urlencoded query strings.
How are multi-byte Unicode characters (emojis, accents) encoded?
Unicode characters are first converted into their UTF-8 byte representation, and each resulting byte is percent-encoded. For example, é becomes %C3%A9 (2 bytes).
What causes double-encoding bugs?
Passing an already-encoded URL through an encoder a second time turns %20 into %2520 (because % is encoded as %25), causing server 404 errors.