Skip to main content
Preparing workspace

URL Parser

Paste a URL and read protocol, host, hostname, port, path and hash line by line, with every query parameter listed as a decoded key = value pair.

Still loading. If the tool doesn’t appear, reload this page.

About this tool

URL Parser

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

URL Parser splits any URL into its component parts using the browser's built-in WHATWG URL constructor — the same parser the address bar uses — and prints protocol, host, hostname, port, path and hash on separate lines, followed by every query parameter as a decoded key = value pair. Because it uses the real parser rather than a regular expression, it applies the same normalisation and percent-decoding a browser would. Anything the constructor rejects comes back as 'Invalid URL', which is itself a useful answer.

How to use URL Parser

  1. Paste a URL into the Input box, or press Load sample to load https://user:pw@example.com:8080/path/page?x=1&y=2#top.

  2. The Result pane updates as you type, printing Protocol, Host, Hostname, Port, Path and Hash — with (default) for an omitted port and (none) for a missing hash.

  3. Read the Query block, where each parameter is indented as key = value already percent-decoded, then press Copy; a string the parser refuses returns Invalid URL.

Why use URL Parser

  • Real parser, not a regex

    It runs the WHATWG URL constructor, so the split matches what a browser would do — including normalisation, default-port handling and percent-decoding of query values.

  • Query strings become a readable list

    Every parameter is listed on its own indented line as key = value with the value already decoded, so %20 and %3A do not have to be read by eye.

  • Tells you when a URL is genuinely invalid

    A string the constructor refuses returns 'Invalid URL' rather than a partial guess, which cleanly identifies a missing scheme or a malformed host.

Common use cases

  • A tracking link arrives with thirty query parameters glued together and you need to read utm_source and the click ID without scrolling a single line sideways.
  • An API call is failing and you want to confirm whether the port is explicit or defaulted, and whether the path really is what you think after the browser normalises it.
  • A redirect URL has a percent-encoded parameter nested inside it, and you need to see the decoded value to tell where it actually points.

Frequently asked questions

What are the parts of a URL?

Scheme, host, port, path, query and fragment. In https://example.com:8080/path/page?x=1#top the protocol is https:, the hostname example.com, the port 8080, the path /path/page, the query x=1 and the hash #top — the six fields this tool prints, plus host, which is hostname and port combined.

Link to answer
What is the difference between host and hostname?

Hostname is the domain alone; host is the domain plus the port when one is present. For https://example.com:8080/ the host is example.com:8080 and the hostname is example.com.

Link to answer
Why does the port say '(default)'?

Because the URL did not state one. For schemes with a defined default (443 for https, 80 for http, and similar for ftp/ws/wss/file) the scheme's default applies; for schemes without a host/port concept (like mailto: or data:) or custom schemes with no defined default, the tool still shows (default) to mean 'no port was present in the URL.'

Link to answer
Does it decode percent-encoded query values?

Yes. Query parameters are read through searchParams, which decodes percent-escapes and converts + to a space, so a value stored as hello%20world is displayed as hello world.

Link to answer