🔗
URL Parser
100% LocalDecompose URLs into protocol, host, path, query, and hash.
URL Parser
Protocolhttps:
Hostnamewww.example.com
Port(default)
Pathname/products
Originhttps://www.example.com
Hostwww.example.com
Hash#reviews
?category=electronics&sort=price&page=2
3
categoryelectronics
sortprice
page2
https://www.example.com/products?category=electronics&sort=price&page=2#reviews
protocolhostnamepathqueryhash
Try:
This tool runs entirely in your browser. Your input is never uploaded, logged, or sent to AllDevToolsHub or anyone else, and it keeps working offline once the page has loaded.
Paste any URL to break down protocol, host, port, path, query parameters, and fragment.
Overview
What is URL Parser?
Parse any URL into protocol, hostname, port, pathname, query params, hash, and auth info. Color-coded visual breakdown with decoded query parameter listing.
FAQ
Frequently Asked Questions
Reference
Technical Deep Dive
URL Parser
Parse any URL into its individual components including protocol, hostname, port, pathname, query parameters, hash, and authentication info. Features a color-coded visual breakdown and decoded query parameter listing.
Every component
Breaks a URL into scheme, userinfo, host, port, path segments, query pairs, and fragment using the WHATWG URL parser.
Encoding-aware
Shows the raw and percent-decoded form of each part so you can see exactly what a server will receive.
Local
URLs — which often carry tokens or IDs in the query string — are parsed in the browser with no request.
01 Component Definition Matrix
| Component | Standard Field | Description | Status |
|---|---|---|---|
| Scheme | protocol | The resource access protocol | Required |
| Host | hostname | DNS name or IP address | Required |
| Search | searchParams | Key-value query data | Optional |
| Fragment | hash | Client-side anchor point | Optional |
02 Parsing Logic Workflow
1
String Sanitization
Input is trimmed and checked for illegal characters before being passed to the native WHATWG constructor.
2
State Machine Decomposition
The URL state machine identifies boundaries like
://, :, /, ?, and #.
3
Recursive Decoding
Query parameters are extracted into a
URLSearchParams object, with automatic UTF-8 percent-decoding applied to each entry.
03 URL Anatomy: RFC 3986 Deep Dive
-
The 8 Components of a URL A fully-qualified URL contains up to 8 components defined in RFC 3986: scheme (https), authority (user:pass@host:port), path (/api/v1/users), query (?page=1&sort=name), and fragment (#section-2). Understanding each component is essential for building correct API clients, parsing redirect URIs, and implementing OAuth callback handlers.
-
Common Parsing Pitfalls The most frequent URL parsing bugs: (1) Forgetting that query parameters can contain encoded characters (%20 vs +), (2) Not handling relative URLs that lack a scheme, (3) Treating the hash fragment as part of the server request (fragments are client-only), (4) Assuming ports are always present (browsers use default 80/443).
-
Security: URL Validation Matters Open redirect vulnerabilities occur when applications blindly follow user-supplied URLs. Always validate that redirect URLs match your expected domain. The URL parser helps you inspect each component to verify scheme (must be https), hostname (must match allowlist), and path (no directory traversal).
04 Related Tools
You Might Also Need
RJRahul JalavadiyaFounder & Lead Engineer
Last reviewed 2026-07-29