URL Parser
Developer Tools · Added
Paste a URL and this breaks it into the components the WHATWG standard defines — scheme, credentials, host, port, path, query and fragment — decodes the query string into a readable table, and points out what is unusual: repeated parameters, credentials in the userinfo, a plus that will decode differently on different servers, or a link long enough to be truncated somewhere downstream.
Result
Normalised URL
https://www.example.com:8443/shop/blue%20widgets/?q=large+widget&sort=price&utm_source=newsletter&utm_medium=email&page=2#reviews
- Scheme
- https
- Host
- www.example.com
- Port
- 8443
- Path segments
- 2
- Query parameters
- 5
- Length
- 129
3 labels
explicit
characters
Components
- protocol
- https:
- username
- —
- password
- —
- hostname
- www.example.com
- port
- 8443
- origin
- https://www.example.com:8443
- pathname
- /shop/blue%20widgets/
- search
- ?q=large+widget&sort=price&utm_source=newsletter&utm_medium=email&page=2
- hash
- #reviews
Path, decoded
Query parameters, decoded
| Key | Value | Notes |
|---|---|---|
| q | large widget | was encoded |
| sort | price | — |
| utm_source | newsletter | tracking |
| utm_medium | tracking | |
| page | 2 | — |
Without the 2 tracking parameters
https://www.example.com:8443/shop/blue%20widgets/?q=large+widget&sort=price&page=2#reviews
These parameters identify the campaign that sent you, not the page you are looking at. Removing them almost always leaves the same page — but a few sites do route on them, so check before sharing something important.
Parameters as JSON
{
"q": "large widget",
"sort": "price",
"utm_source": "newsletter",
"utm_medium": "email",
"page": "2"
}Worth knowing
- There is a + in the query string. In form-encoded data it means a space, but the URL standard treats it as a literal plus in the path — which is why servers disagree about it. Percent-encode it as %2B when a plus is what you mean.
The parsing is the browser's own WHATWG URL implementation, which is the same code that decides what a link in the address bar means. A regular expression cannot reproduce it: percent-encoding sets differ per component, hosts go through IDNA, IPv4 has shorthand forms, and dot segments in the path have to be resolved.
How to use the url parser
- 1Paste a URL. It is parsed as you type, using your browser's own URL implementation.
- 2Read the component table, and the decoded query parameters underneath it.
- 3Copy the parameters as JSON, or take the tracking-free version of the URL.
- 4Check the findings at the bottom — that is where the encoding and security notes appear.
Examples
A tracked marketing link
- Input
- A URL carrying utm_source, utm_medium and a click identifier
- Result
- The same URL with the tracking parameters removed, ready to copy
Those parameters identify the campaign that sent you, not the page you are looking at.
The plus-sign trap
- Input
- ?q=large+widget
- Result
- Decoded as a space, with a note that servers disagree about this
In form encoding a plus is a space; in the URL standard's path rules it is a literal plus. Percent-encode it as %2B when you mean one.
A redundant port
- Input
- https://example.com:443/
- Result
- Flagged as the default for the scheme, and dropped from the normalised form
Which is why the normalised URL can differ from what you pasted.
About the url parser
The parts of a URL, and which ones people get wrong
A full URL is scheme, optional userinfo, host, optional port, path, optional query and optional fragment. The parts that cause trouble are rarely the obvious ones. Userinfo — the user:password@ form before the host — still parses, but modern browsers strip it before making a request, and anything in it lands in proxy and server logs in clear text. Anyone who finds credentials there in a codebase has found a leak.
The fragment is the other commonly misunderstood part. Everything after the hash is never sent to the server at all: it is handled entirely in the browser, which is why single-page applications historically used it for routing and why analytics that only sees server logs is blind to it.
The query string is not really a URL construct either. The standard says only that it is text between the question mark and the fragment; the key=value&key=value convention is a convention, one that HTML form submission established and everything else copied. That is why servers disagree about duplicate keys and about what a plus sign means.
Encoding, and the two ways it goes wrong
Percent-encoding is per-component, which is the source of most confusion. A character that must be escaped in a query value may be perfectly legal in a path, and the sets differ again for the fragment and the hostname. Reaching for a single escape function for the whole URL is how a working link becomes a broken one — encodeURIComponent applied to an entire URL escapes the slashes and the colon.
Double encoding is the other failure. A URL that has been escaped twice contains %2520 where it should contain %20, because the percent sign of the first encoding got encoded again. It usually happens when a value passes through two layers that each helpfully escape it. The tell is a %25 followed by two hex digits, and this tool flags it, because the symptom at the far end — a filename with a literal %20 in it — points nowhere near the cause.
How long is too long
There is no limit in the URL standard, and there are limits everywhere else. The 2,000-character figure that everyone treats as safe traces back to old versions of Internet Explorer, which capped at 2,083, and it stuck because nothing since has been lower. Above it you are relying on every intermediary agreeing: web servers have their own request-line limits, CDNs and proxies impose theirs, and analytics tools and databases often truncate silently rather than erroring.
Silent truncation is what makes long URLs worth flagging. A link that is too long does not usually fail visibly — it works in testing and then loses its last few parameters somewhere in production, which is a considerably harder bug to find than a 414 response would have been.
Frequently asked questions
Why does the normalised URL differ from what I pasted?
Why not just use a regular expression?
What happens with repeated query parameters?
Is it safe to remove the tracking parameters?
Does anything get sent anywhere?
Related tools
URL Encoder / Decoder
Developer Tools
Percent-encode and decode URLs and query parameters, with a query string breakdown.
Punycode Converter
Developer Tools
Convert internationalised domain names between their Unicode and xn-- forms, with a mixed-script warning.
Redirect Map Generator
Developer Tools
Turns a list of old and new URLs into server redirect rules, and finds the loops and chains first.
ASCII Table
Developer Tools
Searchable ASCII reference with decimal, hex, octal, binary and escapes.