How to use the url parser
- Paste or type a full URL into the input field, making sure it includes the scheme such as
https://. - The url parser automatically breaks the URL into its core components like protocol, hostname, port and path.
- Review the table below the components to see every query parameter and path segment as written, next to its percent-decoded value (repeated keys are listed separately).
- Check the path rows to see how the pathname is divided by each slash.
How the URL Breakdown Works
A URL follows a strict grammar defined in RFC 3986. The general form is scheme://[user[:password]@]host[:port]/path[?query][#fragment]. When you enter a URL, the parser uses the standard URL API available in modern browsers and Node.js to split the string into these parts.
For example, given https://user:pw@example.com:8080/a/b?x=1&y=2#frag, the scheme is https:, the credentials are user and pw, the host is example.com, the port is 8080, the path is /a/b, the query string is ?x=1&y=2 and the fragment is #frag. Each piece maps directly to a property on the parsed object.
Understanding Query Parameters
The query string starts after the first question mark and contains key-value pairs separated by ampersands. A query string parser must handle several edge cases: keys without values, repeated keys and percent-encoded characters.
When a value contains spaces or special characters, they are encoded using percent-encoding. For instance, a space becomes %20, so q=a%20b decodes to a b. Repeated keys like x=1&x=3 are preserved as separate entries rather than overwritten, which matches how most server-side frameworks process incoming requests.
The table lists each parameter exactly as it appears in the address under Value as written, and the Decoded column shows that value after a single pass of percent-decoding, with a plus sign read as a space. Decoding only once matters: a value written as 100%2525 decodes to 100%25, and decoding it a second time would wrongly give 100%. Path segments get the same treatment, so a segment such as my%20file.txt is shown as written and as my file.txt.
Common URL Components Reference
The following table shows what each component represents in a typical web address.
| Component | Description | Example |
|---|---|---|
| Protocol | The scheme plus colon | https: |
| Username | User info before the at sign | admin |
| Password | Secret after the colon in user info | s3cret |
| Hostname | Domain name or IP address | example.com |
| Port | Number after the colon following the host | 8080 |
| Origin | Protocol plus hostname plus port | https://example.com:8080 |
| Pathname | Path after the host, starting with a slash | /docs/api |
| Search | Query string including the question mark | ?page=2 |
| Hash | Fragment identifier including the hash symbol | #section-3 |
Why the Scheme Is Required
If you type example.com/path without a scheme, the parser cannot determine whether example.com is a hostname or part of a relative path. Browsers resolve this ambiguity by defaulting to the current page's origin, but a standalone tool has no such context.
To avoid guessing and producing incorrect results, this url parser requires you to include the scheme. The one exception is a bare host and port such as localhost:3000/path: the parser recognises the digits after the colon as a port, shows the host and port, and leaves the protocol as not given. Simply add https:// (or http://, ftp://, etc.) before the domain. This ensures every url breakdown is accurate and unambiguous.
Practical Uses for Developers
Developers frequently need to inspect URLs when debugging routing issues, verifying redirect targets or analyzing API endpoints. Pasting a long URL with multiple query parameters into a visual parser makes it much easier to spot typos or unexpected encoding.
This tool complements other developer utilities. If you are working with encoded data, you might also use the URL encoder to prepare strings safely. For examining HTTP responses, the HTTP status codes reference helps interpret server replies. When building APIs that return structured data, tools like the JSON formatter make payloads readable.
Worked examples
| Example | Input | Result |
|---|---|---|
| Full URL with auth and query | URL: https://user:pw@example.com:8080/a/b?x=1&y=2&x=3#frag | Protocol: https:; Username: user; Password: pw; Hostname: example.com; Port: 8080; Origin: https://example.com:8080; Pathname: /a/b; Search: ?x=1&y=2&x=3; Hash: #frag |
| Simple HTTPS URL | URL: https://example.com | Protocol: https:; Username: (none); Password: (none); Hostname: example.com; Port: (default); Origin: https://example.com; Pathname: /; Search: (none); Hash: (none) |
| Encoded query parameter | URL: https://search.example.com/?q=a%20b&lang=en | Protocol: https:; Username: (none); Password: (none); Hostname: search.example.com; Port: (default); Origin: https://search.example.com; Pathname: /; Search: ?q=a%20b&lang=en; Hash: (none) |
| FTP with port | URL: ftp://files.example.org:21/pub/readme.txt | Protocol: ftp:; Username: (none); Password: (none); Hostname: files.example.org; Port: (default); Origin: ftp://files.example.org; Pathname: /pub/readme.txt; Search: (none); Hash: (none) |
| Bare host and port | URL: localhost:3000/api/users?id=42 | Protocol: (none given); Username: (none); Password: (none); Hostname: localhost; Port: 3000; Origin: (needs a scheme); Pathname: /api/users; Search: ?id=42; Hash: (none) |
FAQ
What is a url parser?
A url parser is a tool that takes a URL string and splits it into its individual components such as protocol, hostname, port, path, query parameters and fragment identifier.
Why does my URL fail to parse?
The most common reason is a missing scheme. You must include http:// or https:// at the beginning (a bare host and port such as localhost:3000 is the only exception). Without a scheme, the parser cannot reliably identify the hostname.
Are repeated query parameters supported?
Yes. If a URL contains the same key multiple times, such as x=1 and x=3, each occurrence is listed separately in the query parameters table.
Is my URL sent to a server?
No. Parsing happens entirely in your browser using the built-in URL API. Nothing is uploaded or transmitted anywhere.
What does percent-decoding mean?
URLs encode special characters using a percent sign followed by two hexadecimal digits. For example, %20 represents a space. The Decoded column shows each value after one pass of decoding, so double-encoded text is not decoded twice.
Can I parse non-HTTP URLs?
Yes. Any valid scheme works, including ftp://, mailto:, file:// and custom protocols used in desktop or mobile applications.