URL Parser
Parse a URL with the browser URL API and display protocol, host, hostname, port, pathname, search, hash, and username as JSON.
How to use
- Enter an absolute URL and run.
Capabilities and scope
The tool relies on the WHATWG URL parser rather than implementing URL grammar manually.
How it works
Properties from new URL(input) are copied into an object and serialized with two-space JSON.
Example
https://[email protected]:443/path?q=1#x can be inspected component by component.
Useful for
- Debug the structure of a complex URL
Before you use it
- Relative URLs requiring a base cannot be parsed alone, and the password property is not included in the current result object.
Standards and references
Frequently asked questions
Can I enter just /path?
No. The current new URL(input) call has no base URL, so an absolute URL is required.