← Back

URL Parser

Break a URL into its parts and query parameters

Components
Protocolhttps:
Hostnameexample.com
Port8080
Pathname/path/page
Search?id=123&name=test
Hash#section1
Originhttps://example.com:8080
Query parameters (2)
KeyValue
id123
nametest

About URL Parser

The URL parser takes a web address apart and lists its protocol, hostname, port, pathname, search string, hash and origin, then turns the query string into a Key / Value table. It relies on the browser's built-in standard URL parser, so what you see matches what new URL() returns in a web script. It only analyses the text you type: it never visits the address, and it cannot tell you whether the page exists or is safe. It is handy for untangling links with long parameter lists, checking redirect targets and debugging API requests.

How to use it

  1. Paste a full address into 'Input URL'. It must include a scheme such as https://. The page starts with an example URL already filled in.
  2. When the input is valid, the 'Components' section lists seven rows: Protocol, Hostname, Port, Pathname, Search, Hash and Origin. The copy button at its top right copies them as 'name: value' lines.
  3. If the address has a query string after the ?, a 'Query parameters (N)' table appears with a 'Key' and a 'Value' column. Values are already URL-decoded. Its copy button copies the parameters as JSON.
  4. If the text can't be parsed, a red message appears: 'Not a valid URL (it must include a scheme such as http:// or https://)'. Add the scheme and it will parse.

A worked example (actually computed)

The default example https://example.com:8080/path/page?id=123&name=test#section1 gives: protocol https:, hostname example.com, port 8080, pathname /path/page, search ?id=123&name=test, hash #section1, origin https://example.com:8080, and a parameter table with two rows, id = 123 and name = test. A second example with encoding: https://example.com/search?q=hello%20world&tag=a&tag=b shows the port as '(default)', decodes q to 'hello world', and lists tag twice in the table, once as a and once as b. These results come from running the same standard parser the tool uses.

What it supports and where it stops

  • A scheme is required. Typing only example.com/a is reported as invalid, and the tool will not add https:// for you.
  • The Port row shows the number when the URL spells out a non-default port. If no port is written it shows '(default)'; if the scheme's default port is written explicitly (such as :443 for https), it shows '443 (default port)'.
  • The query table lists repeated keys in full (both tag rows above), and the copied JSON keeps them too: a repeated key becomes an array, so tag gives ['a', 'b'].
  • For addresses without a standard host, such as mailto: or file:, the standard parser gives no usable origin (its value is the string null), and the Origin row shows '(none)'.
  • An internationalised domain name is displayed in the punycode form (starting with xn--) that the browser produces.
  • Parse only: it doesn't check whether a link opens, expand short links or follow redirects.
  • The Components list shows the standard fields only; it does not split out credentials, subdomains or the top-level domain.

FAQ: Why does it say 'Not a valid URL'?

Most often the scheme is missing, for example when you paste www.example.com/page. Put https:// in front and it will parse. Spaces in the address, a malformed scheme such as 'htp://', or an invalid port number can also make it fail.

FAQ: How are percent-encoded characters shown?

The Value column is decoded, so %20 appears as a space and UTF-8 percent-encoded Chinese appears as characters. The 'Search' row, however, shows the raw encoded text so you can compare it with the original link.

FAQ: Why isn't the part after # in the parameter table?

The hash is used by the browser locally and normally isn't sent to the server with the request, and it isn't part of the query string. Some single-page apps keep their route there; you can read it in the Hash row, but it isn't split into a parameter table.

FAQ: Can it tell me whether a link is safe?

No. It only splits text, so it can't recognise a phishing link. It does help you see the real hostname, though. In https://example.com@evil.test/ the actual host is evil.test, not the example.com that comes first, and the breakdown makes that obvious.

Privacy and processing

Parsing happens in your browser and the tool makes no network requests. The address you type is not uploaded, stored or visited. Reloading the page restores the example URL. Links that contain login tokens or secret keys in their parameters should still not be pasted into places you don't trust or shared casually.