Explainer1 min readUpdated June 25, 2026
The anatomy of a URL
Short answer
A URL is built from a scheme (https), a host (example.com), an optional port, a path (/products/42), an optional query string (?ref=home), and an optional fragment (#reviews). Each part tells the browser something different about where to go and what to request.
A labelled example
https://shop.example.com:443/products/42?ref=home#reviews
\___/ \_____________/ \_/ \__________/ \______/ \_____/
scheme host port path query fragmentWhat each part does
scheme— the protocol, usuallyhttps, which tells the browser how to connecthost— the domain name (or IP) of the serverport— which port to connect to; defaults are 443 for https and 80 for http, so it is usually omittedpath— which resource on the server to requestquery— extra parameters after?, written askey=valuepairs joined by&fragment— the part after#, used by the browser to jump to a section; it is not sent to the server
The fragment stays in the browserEverything after
# is handled by the browser, not the server. That is why in-page anchors like #reviews do not trigger a new request.Try it: URL ParserPaste a URL to see its scheme, host, path, port, and decoded query parameters.Open tool