Anatomy of a URI Under RFC 3986 and the WHATWG URL Standard
Every web address is governed by the IETF RFC 3986Uniform Resource Identifier (URI) specification and the livingWHATWG URL Standard implemented across modern browsers, Node.js, Deno, and Cloudflare Workers. Deconstructing a complex URL into its canonical components makes debugging OAuth callbacks, webhook endpoints, and paginated REST requests straightforward:
- Scheme (Protocol): Specifies the transport protocol (such as
https:orwss:) and implies the default port (443for HTTPS,80for HTTP). - Authority (Hostname & Port): Contains the registered domain name, IPv4/IPv6 literal, and optional explicit port (e.g.,
:8443). - Hierarchical Pathname: Identifies the target resource on the origin server (such as
/v1/search). - Query String: Begins with
?and carries ordered key-value pairs separated by&, including repeated keys used for multi-select filters. - Fragment Identifier (Hash): Begins with
#and is evaluated strictly client-side without being transmitted in HTTP requests.
Space Serialization: RFC 3986 (%20) vs. Form Encoding (+)
Subtle signature mismatches in API gateways and OAuth 2.0 flows frequently stem from how spaces are encoded inside query parameters:
- RFC 3986 Strict Percent-Encoding (
%20):Encodes spaces as%20. This is required by AWS Signature V4 canonical request signing, strict RFC URI parsers, and modern OAuth redirect validators. - HTML Form Encoding (
+): The browser's nativeURLSearchParamsserializer follows theapplication/x-www-form-urlencodedspecification, which replaces spaces with+.
Use the toolbar toggle above to switch between %20 and+ serialization on the fly, strip marketing tracking parameters (utm_*, gclid, fbclid), and export either a structured JSON payload (preserving duplicate keys as arrays) or a POSIX-safe curl command with escaped single quotes.
Practical Real-World Use Cases
- Debugging OAuth 2.0 & OpenID Connect Redirects:Inspect nested
redirect_uri,state,code_challenge, andscopeparameters without manually decoding percent-escaped strings. - Testing Paginated REST & GraphQL Endpoints: Toggle individual filter parameters on and off via checkboxes and copy a POSIX-escaped
curl -X GETsnippet directly into your terminal. - Sanitizing Tracked Marketing Links: Strip
utm_*,gclid,fbclid, andmsclkidtracking parameters before bookmarking or sharing clean canonical URLs, or build new campaign links with our UTM Link Builder.
Absolute Privacy
URLs copied from browser network tabs, server access logs, or OAuth 2.0 redirect flows frequently contain sensitive session state, API keys, signed webhook tokens, or internal staging hostnames. This parser and query builder executes 100% locally inside your browser using the native WHATWG URL and URLSearchParams APIs—none of your links or query parameters are ever transmitted to an external server.
Frequently Asked Questions
What is the difference between RFC 3986 (%20) and Form (+) space encoding in query strings?
RFC 3986 percent-encodes spaces as %20 (required by strict URI parsers and AWS Signature V4), whereas HTML application/x-www-form-urlencoded (used by default in URLSearchParams) encodes spaces as +.
How are duplicate query parameter keys exported to JSON?
Single-occurrence query parameters export as string values, while repeated keys (such as ?tag=astro&tag=preact) are automatically grouped into a JSON string array.