URL Parser

Break a URL into protocol, host, port, path, query and hash.

Free URL parser that splits any URL into its protocol, host, port, path, query parameters and fragment. Runs entirely in your browser — nothing is uploaded. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What parts of a URL does it show?

It breaks the URL into protocol, username, password, hostname, port, origin, path, query string, individual query parameters and the #fragment.

URL parser

Every web address packs several pieces of information into one string: the scheme, the authority (host and optional port), an optional path, a query string, and a fragment. This parser splits any absolute URL into those components using the browser’s native URL API, so the breakdown matches exactly how browsers and servers interpret the address — useful for debugging links, reading long tracking URLs, dissecting API endpoints, or building integrations.

Anatomy of a URL

The RFC 3986 structure of a URL is:

scheme "://" [userinfo "@"] host [":" port] path ["?" query] ["#" fragment]

For example:

https://user:[email protected]:8443/products/shoes?id=42&ref=email#reviews
│       │         │                │    │              │                │
scheme  userinfo  hostname         port path           query           fragment

Most URLs omit the userinfo and port. The path, query, and fragment are each optional too.

How it works

The tool constructs a URL object from your input and reads its standard properties:

  • Protocol (https:, ftp:, etc.) — the scheme including the trailing colon
  • Username and password — present in URLs like ftp://user:pass@host; typically empty in web URLs
  • Hostname — the domain without port (shop.example.com)
  • Host — hostname plus port when a non-default port is present (shop.example.com:8443)
  • Port — only the port number when explicitly given; empty if the default port for the scheme is used
  • Origin — scheme + hostname + port; the unit browsers use for same-origin security checks
  • Pathname — the path portion starting with /
  • Search — the raw query string including the leading ?
  • Hash — the fragment including the leading #

It then walks the query string with URLSearchParams, percent-decoding each parameter automatically, and lists each key–value pair individually.

Worked example

Input URL: https://shop.example.com:8443/products?id=42&ref=email%40domain.com#reviews

ComponentValueNotes
Protocolhttps:Scheme with colon
Hostnameshop.example.comNo port
Port8443Non-default HTTPS port
Originhttps://shop.example.com:8443Scheme + host + port
Pathname/productsPath only
Search?id=42&ref=email%40domain.comRaw, still encoded
Hash#reviewsFragment
Query: id42Decoded
Query: ref[email protected]%40 decoded to @

The query parameter ref is shown decoded — [email protected] rather than email%40domain.com — because URLSearchParams decodes values automatically.

The fragment is never sent to the server

The hash / fragment (#reviews in the example above) is handled entirely by the browser. It is stripped from the HTTP request before it is sent to the server, which is why server logs never show it. It is used for:

  • In-page anchors: scrolling to a specific heading or element
  • Single-page-app routing: React Router, Vue Router, and similar libraries use the hash to represent the current view without making a server request
  • OAuth redirect parameters: some OAuth flows carry tokens in the fragment specifically because it is not sent to the server

Common reasons a URL fails to parse

The URL API requires an absolute URL with a scheme. Common problems:

InputProblemFix
example.com/pathNo schemeAdd https://https://example.com/path
/path?q=1Relative URLNeeds a base URL; add the full origin
javascript:alert()Invalid scheme for this parserSupply an http/https URL
URLs with spacesSpaces are not allowed unencodedEncode as %20 first

Everything runs in your browser using the built-in URL API — nothing is uploaded.