URL Parser
Parse a URL into scheme, host, port, path, query parameters and fragment, with the parsing traps that cause security bugs.
Last reviewed by the Radiatus Cloud team
URL Parser
Parse a URL into its constituent parts (Protocol, Host, Path, Parameters, etc).
Need this built for your product?
We design, build & host secure software & APIs.
The anatomy
A URL splits into scheme, an optional userinfo section, host, optional port, path, query and fragment. Each has its own escaping rules, and treating a URL as a single string rather than a structured value is where most URL bugs begin.
The fragment never leaves the browser
Everything after the hash is client-side only and is not sent to the server. Putting a token or any parameter in a fragment and expecting server-side code to read it produces a bug that is confusing precisely because the value is plainly visible in the address bar. Conversely, this is why fragments are sometimes used deliberately for values that must not reach the server.
Query parameters can repeat
A query string may contain the same key more than once, and there is no specification saying what that means. PHP keeps the last occurrence unless the key ends in brackets; other stacks keep the first, or return an array. This inconsistency is exploited in HTTP parameter pollution attacks, where a proxy and an application disagree about which value counts. Never assume a key appears once.
The host is where security bugs live
Naive validation of a redirect target is a reliable source of open-redirect vulnerabilities. A string starting with a slash-slash is protocol-relative and points at another host entirely. Userinfo before an at-sign lets a URL appear to point at your domain while resolving elsewhere. Unicode characters that render like ASCII enable homograph domains. Parse the URL properly and compare the resolved host against an allowlist; never pattern-match the string.
Plus means different things in different places
In a query string, a plus sign conventionally means a space, because form encoding says so. In a path it is a literal plus. The same character therefore decodes differently depending on which part of the URL it is in, which is why email addresses with tagged aliases break so often.
Length limits are real but generous
The specification sets no limit, but browsers and servers do: around 2,000 characters is the practical ceiling for broad compatibility, and some servers reject longer request lines outright. Anything approaching that should be a POST body rather than a query string.
Related tools
- JSON Formatter — Format and beautify JSON in your browser. Pinpoints syntax errors by line and column, flags unsafe integers, and never uploads your data to a server.
- JSON Validator — Validate JSON syntax with precise line and column errors, and check documents against a JSON Schema. Runs locally in your browser, nothing uploaded.
- Regex Tester — Test regular expressions against sample text with live match highlighting, capture groups and flag control. Runs entirely in your browser.
- HTML Minifier — Minify HTML by removing comments and redundant whitespace, without breaking inline elements or pre blocks. Runs entirely in your browser.
Frequently Asked Questions
Is the fragment sent to the server?
No. Everything after the hash stays in the browser. Reading it server-side is impossible, which surprises people because the value is visible in the address bar.
What happens with duplicate query parameters?
It depends on the stack: PHP keeps the last, others keep the first or return an array. There is no specification, and the disagreement between a proxy and an application is the basis of parameter pollution attacks.
Why does a plus sign sometimes become a space?
Because form encoding defines it that way in query strings, while in a path it is a literal plus. The same character decodes differently by position, which is why tagged email addresses break so often.
How should I validate a redirect target?
Parse the URL and compare the resolved host against an allowlist. Never pattern-match the string: a leading double slash is protocol-relative, and userinfo before an at-sign disguises the real host.
Is there a maximum URL length?
Not in the specification, but browsers and servers impose one. Around 2,000 characters is the safe practical ceiling; anything longer belongs in a POST body.
Privacy & Security
Local processing.
About This Tool
This tool runs entirely in your browser. No data is sent to any server, ensuring complete privacy. Simply use the interface above to get started — no registration or login required.
Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.
Related Tools
JSON Formatter
DeveloperFormat and beautify JSON in your browser. Pinpoints syntax errors by line and column, flags unsafe integers, and never uploads your data to a server.
JSON Validator
DeveloperValidate JSON syntax with precise line and column errors, and check documents against a JSON Schema. Runs locally in your browser, nothing uploaded.
Regex Tester
DeveloperTest regular expressions against sample text with live match highlighting, capture groups and flag control. Runs entirely in your browser.