URL Parser

Split a URL into protocol, host, port, path, query and hash, and list each query parameter.

What this splits, and what it does not encode

A link is several fields with different rules. The host is not the path, the query is not the hash, and a port of 443 is usually left off. This page lists those fields and each query parameter. It does not percent-encode anything. For that, use URL encode. For an international host written as xn--, use punycode.

How to use it

  1. Paste a full address, or a host with a path such as example.com/search?q=1.
  2. Leave “Update as you type” on. The result lists protocol, username, host, port, path, query, hash and origin, then each query parameter as key = value.
  3. If the box has no http:// or https://, the first line says https was assumed. That line is a note, not part of the URL you pasted.
  4. Copy the result. Clear empties both boxes. The example is a URL with a user, a password, port 8080, the query tea and a hash.

How the fields are read

The browser’s URL parser does the split. A missing port shows as the default for that scheme. https is 443 and http is 80, and the line says default so you can tell it was not typed. The user and password stay in the username line when they are present; do not paste a live password here if the screen is shared.

Query values are decoded, so %E5%8C%97%E4%BA%AC shows as 北京. A hash after # is not sent to most servers; it is still listed because the browser keeps it. A string with no host, such as a bare word, is rejected instead of being treated as a path.

Where this is the page you want

  • Checking which parameter a redirect actually set.
  • Seeing whether a port or a user was hiding in a copied link.
  • Pulling the origin out before you compare two addresses.

Questions

Why did https appear when I did not type it?

A host without a scheme is not a full URL. The page adds https:// so the parser has a scheme, and it says so on the first line.

The query looks decoded. I needed the percent form.

This page shows the characters. Encode the value again with URL encode if you are building a new link.