How to use URL Parser
- Paste a URL (schemes are optional — https:// is assumed).
- Read the components table; the note column explains defaults, IDN forms and special cases.
- Expand the query table or the JSON view to work with individual parameters.
URL Parser features
- WHATWG-compliant parsing identical to browsers, including normalisation of scheme, host, ports and dot segments
- Component table: href, protocol, credentials, origin, host, hostname, port, path, query, fragment, registrable domain, subdomain and TLD
- Decoded path segments and a query table with position, decoded key/value and raw form
- Internationalised domain names displayed in Unicode next to their punycode (xn--) form
- Warnings for embedded credentials, plain HTTP, over-long URLs and labels; notes about what normalisation changed
- JSON view of the whole structure for copy/paste into tests
URL Parser example
Break down a complex URL
Input:
https://user:pw@shop.example.co.uk:8443/catalog/../search?q=caf%C3%A9&tag=new&tag=sale#resultsOutput:
href: https://user:pw@shop.example.co.uk:8443/search?q=caf%C3%A9&tag=new&tag=sale#results
origin: https://shop.example.co.uk:8443 · hostname: shop.example.co.uk · port: 8443
registrable domain: example.co.uk · subdomain: shop
query: q=café, tag=new, tag=sale (repeated) · hash: #results (never sent)
Warning: the URL embeds credentials.Frequently asked questions about URL Parser
What is the difference between host and hostname?
hostname is only the domain or IP (example.com); host also includes a non-default port (example.com:8443). origin combines scheme, hostname and port and is what CORS and the same-origin policy compare.
Why did the URL change after parsing?
The parser normalises exactly like browsers do: lower-cases the scheme and host, removes default ports, resolves ../ segments, adds a trailing slash to an empty path and percent-encodes characters that are not allowed. The notes list what changed.
How are internationalised domain names shown?
Hosts containing non-ASCII characters are converted to punycode (xn--…) in the href, and the tool shows the Unicode form next to it so you can verify it is not a look-alike domain.
Is the fragment (#…) sent to the server?
No. Everything after # stays in the browser and is used by client-side routers and anchors. The tool marks it accordingly.
Technical notes
The engine wraps the platform URL class (available in every modern browser, Node and Workers) and adds what it lacks: punycode decoding per RFC 3492 for display, an approximate registrable-domain split using a list of common multi-part suffixes, and structured query parsing.