How URL Encoding Works
Percent-encoding (also called URL encoding) replaces unsafe characters with a % sign followed by two hexadecimal digits representing the byte value. For example, a space becomes %20 and é (U+00E9) becomes %C3%A9 in UTF-8. This allows any Unicode character to safely appear in a URL.
The two JavaScript functions behave differently. encodeURIComponent is the stricter one: it encodes everything except letters, digits, and - _ . ! ~ * ' ( ). Use it for query string values and path segments. encodeURI is lenient: it leaves the structural characters : / ? # [ ] @ ! $ & ' ( ) * + , ; = intact because it assumes you're passing a complete URL.
The URL parser mode uses the browser's built-in URL API (WHATWG URL Standard) to decompose any valid URL into protocol, host, path, query parameters, and hash fragment — displayed as a table for easy inspection.
References
URL syntax and percent-encoding are formally defined in RFC 3986 — Uniform Resource Identifier (URI): Generic Syntax (T. Berners-Lee, R. Fielding, L. Masinter, January 2005, rfc-editor.org/rfc/rfc3986). Section 2.1 defines percent-encoding; Section 3 defines the generic URI syntax (scheme, authority, path, query, fragment). The URL parser uses the WHATWG URL Standard implemented natively in all modern browsers.
What's here — and what's not
Two-way encoding/decoding, a clear explanation of when to use encodeURIComponent vs encodeURI, Unicode correctness, a swap button, and a URL parser that breaks any URL into a clean table of components including all query parameters individually.
What isn't here: batch encoding of multiple values at once, a query string builder (building a URL from scratch by filling in fields), or encoding mode comparison side by side. These would be useful but add enough UI complexity to belong in a more specialized tool.