URL Parser Online
Break any URL into protocol, hostname, path, query parameters, and fragment.
When a URL parser is the right tool
A URL is one string that hides several parts: a scheme, optional credentials, a host, a port, a path, a query, and a fragment. A parser is for the moment you need those parts laid out, such as when a request fails and you want to see whether the port or a query value is wrong. You paste a complete URL and the components appear as you type.
The input must include a scheme, typically https:// or http://. This is not a percent-encoder. To encode or decode a single component, use the URL Encoder.
Use cases
Inspecting an API URL you were given
An endpoint often arrives as one long string. Parsing it makes the host, port, path, and each query parameter visible on its own row, which is easier than counting ampersands by eye. Load Sample pastes a fictional API URL with credentials, a non-default port, a query, and a fragment so you can see every field.
Checking how a query value is decoded
The search row shows the raw query, including + signs. The parameter table shows the decoded values, so hello+world appears as hello world. That distinction matters when you are about to copy a value into code.
Confirming credentials or a fragment
Userinfo and the hash are easy to miss in a long URL. If they are present, they get their own rows (the fragment includes the leading #). Do not paste a real password unless you would be comfortable with it sitting in this tab's memory.
How parsing works
The input is trimmed and passed to new URL(...). If the constructor throws, the page reports an invalid URL. If it succeeds, the table is filled from the URL object: protocol (including the colon), username, password, hostname, port, pathname, search (including the ?), and hash (including the #). Empty values are omitted, which is why a default port does not appear. Query parameters are listed from searchParams, in order, with values decoded.
There is no “Parse” button; the result updates as you type. There is no base URL, so relative paths are not resolved.
https://user:pass@api.example.com:8080/v1/search?q=hello+world&page=2&sort=desc#results
protocol https:
username user
password pass
hostname api.example.com
port 8080
pathname /v1/search
search ?q=hello+world&page=2&sort=desc
hash #results
query q = hello world
page = 2
sort = descThe protocol includes the colon, the path includes the leading slash, and the query and fragment keep their leading ? and #. The parameter table decodes hello+world to a value with a space.
What this tool does not do
It does not fetch the URL, follow redirects, or resolve a relative path. It does not percent-encode a component for you, and it does not offer a copy button on each row. Nothing is sent to a server. Unusual schemes may parse if the browser accepts them, but this page is aimed at ordinary http and https addresses.
How to use URL Parser
- Paste a complete URL, including the scheme, into the input.
- Read the component table and, if present, the query parameter list. The view updates as you type.
- Use Load Sample to try a fictional API URL first, then replace it with the address you actually need to inspect.
Frequently asked questions
Why is my URL reported as invalid?
The page uses the browser’s URL constructor, which requires a scheme such as https:// or http://. A relative path like /search?q=1, or a host without a scheme such as example.com/path, will fail. The error message asks you to include a scheme. There is no base URL to resolve relative references against.
Why is the port field missing for https://example.com?
The URL API leaves the port property empty when the port is the default for the scheme (80 for http, 443 for https). Empty components are hidden in the table, so a default port does not appear. A non-default port such as 8080 is shown.
How are query parameters decoded?
The raw query string is shown in the search row, including the leading ?. The parameter table is built from URLSearchParams, which decodes values and treats + as a space. So q=hello+world appears as the value hello world in the table, while the search row still shows the original +.
Are duplicate query keys preserved?
Yes. Each key/value pair from URLSearchParams is listed in order, so two values for the same key appear as two rows. There is no option to keep only the first or last value.
Is the URL sent to a server?
No. Parsing runs in your browser as you type. Closing the tab discards what you pasted. If the URL contains credentials or a signed token in the query, treat it as sensitive and do not paste it if you would not be comfortable with it sitting in memory on this device.
Can I parse a URL that has a username and password?
Yes. The constructor accepts userinfo, and the username and password are shown when they are present. Load Sample uses a fictional https://user:pass@… address so you can see those fields without pasting a real credential.
Is there a copy button for each field?
No. The components are displayed as a table. You can select and copy a value from the page, but there is no per-field copy control.
Related tools and guides
References
- The URL API is what this page uses to split the input. It follows the WHATWG URL Standard, not a looser “any string that looks like a link” parser.
- RFC 3986 describes the generic URI syntax: scheme, authority, path, query, and fragment. The table on this page maps those parts to the names the URL object uses (
protocol,hostname,pathname,search,hash).