URL Parser
WM-02Paste a URL to see its protocol, host, port, path, query string and hash on separate lines, with every query parameter decoded in a table. It uses your browser's own URL parser.
Runs in your browser. Nothing is uploaded.
URL
Parts
How to use it
- Paste one full URL, starting with a scheme such as https://, into the input box.
- Press Parse if the result has not already appeared.
- Read the parts: protocol, host, port, origin, path, query and hash.
- Check the query parameters table. Each name and decoded value is on its own row.
- Copy the result, or use Share link to send the URL to someone.
The parts of a URL
In https://example.com:8443/docs/page?q=1#top, the protocol is https:, the host is example.com:8443, the hostname is example.com, the port is 8443, the path is /docs/page, the query is ?q=1 and the hash is #top. The origin is protocol, host and port together. If the URL has no port, the table shows the default for the protocol, such as 443 for https, and says it is not written in the URL.
Query parameters and decoding
Everything after the ? and before the # is the query string. It is split on & into name and value pairs, and each is shown percent-decoded, so %C3%A3 appears as ã. A plus sign is read as a space, which is how HTML forms write them. If a name appears twice, such as tag=a&tag=b, you get two rows in the order they appear. The Path (decoded) line shows the path with %20 and similar codes turned back into characters.
Relative URLs need a base
A relative URL such as /docs/page?x=1 has no scheme or host, so it cannot be split on its own. It only means something when it is joined to a base address, like the page it appears on. Add the scheme and host in front, for example https://example.com/docs/page?x=1. Internationalized host names are shown in their ASCII form, which starts with xn--.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
Not an absolute URL. "/docs/page" has no scheme (such as https://), so it cannot be parsed without a base URL. Add one, for example https://example.com/docs/page. | The text is a relative path or a bare host. | Put a scheme and host in front, such as https://example.com. |
Not a valid URL. Check the part after "https:" (host, port and characters). | It has a scheme but the rest could not be read, for example a bad port or an empty host. | Check the host and port. A port must be a number from 0 to 65535. |
Enter one URL on one line. | The box holds more than one line. | Paste one URL at a time. |
Questions people ask
How do I get the query parameters from a URL?
Paste the URL and read the table under the parts list. Every parameter has its own row with its name and decoded value, in the order it appears. Parameters that repeat show up as separate rows. Nothing is sent anywhere.
What is the difference between host and hostname?
The hostname is only the domain name, such as example.com. The host is the hostname plus the port when the URL gives one, such as example.com:8443. When there is no port in the URL, host and hostname are the same.
What is the origin of a URL?
The origin is the protocol, hostname and port together, for example https://example.com:8443. Browsers use it for same-origin checks and CORS. The path, query and hash are not part of it.
Why does the parser say my URL is not absolute?
An absolute URL has a scheme, such as https://. Text like /docs/page or example.com/docs has none, so the browser parser cannot tell what it belongs to. Add https:// and the host in front and parse it again.
Is the hash sent to the server?
No. The part after # stays in the browser. It is used by the page itself, for example to jump to a heading, and is left out of the request that goes to the server.
Does a plus sign in a query value mean a space?
In query strings it does here: the parser reads + as a space, as HTML forms do, and shows it that way in the table. In the path, a plus stays a plus. A literal plus in a value is written as %2B.
About this tool
Uses the URL parser built into your browser, so the split follows the WHATWG URL standard. The URL must be absolute, with a scheme such as https://; a relative path like /docs/page has nothing to resolve against and gives an error. Query values are decoded, and + counts as a space. Repeated names are listed as separate rows. Internationalized host names are shown in their ASCII (punycode) form. The page does not fetch the address or check that it exists.