URL Parser
Parse URL components
Parse URL components Runs locally in your browser
A complete URL, including http:// or https://.
About the
The URL Parser breaks a web address into its parts and labels each one: protocol, host, port, path, query string and fragment. Reading a URL as a single string is what makes query parameters so easy to get wrong, because the question mark, the ampersand and the hash each have a specific meaning and the order matters. Splitting it out shows you exactly what the server will receive and what the browser will keep to itself, which is usually the answer when a link behaves unexpectedly.
Where people use the
- Working out why a parameter is not reaching the server.
- Checking which host a shortened or redirected URL actually points at.
- Splitting a query string before rewriting it.
- Confirming a fragment was mistakenly used where a query was needed.
How to use the
- 1
Paste a complete URL
Include the scheme. A bare domain such as example.com is not a valid URL and will be rejected; use https://example.com.
- 2
Parse it
Each component appears on its own line with its name.
- 3
Read the query string separately
Everything after the question mark is the query. Parameters are separated by ampersands and each is a name=value pair.
- 4
Note what is missing from the output
An empty port or fragment simply means the URL did not specify one. The default port is implied by the scheme: 443 for https, 80 for http.
Tips and best practices
- Anything after the hash never reaches the server; put parameters before it.
- Percent-encode ampersands and equals signs that belong inside a value.
- Always include the scheme when testing, even though browsers hide it.
Frequently asked questions
Why does it reject my URL?
Because it has no scheme. Parsing needs http:// or https:// at the front; without it there is no way to tell a host from a path. Add the scheme and try again.
What is the difference between the query and the fragment?
The query, after the question mark, is sent to the server. The fragment, after the hash, is not: the browser keeps it locally and uses it to scroll to an element. That is why parameters placed after a hash never reach your server.
Why is the port empty?
Because the URL did not state one. Browsers use the default for the scheme, 443 for https and 80 for http, so an empty port is normal rather than an error.
Does it decode percent-encoded values?
No. It reports the query string exactly as it appears. Decode individual values with the URL Encoder if you need to read them.
Why did my ampersand disappear from a parameter value?
Because an ampersand separates parameters. A literal ampersand inside a value has to be percent-encoded as %26, otherwise the parser is correct to treat it as a boundary.