Skip to content
AZ Tools

URL Parser

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

Protocol

https:

Origin

https://example.com:8080

Hostname

example.com

Port

8080

Pathname

/path/to/page

Search

?q=hello&lang=en

Hash

#section

Username

user

Password

pass

Query parameters

KeyValue
qhello
langen

Parsing uses the browser's native URL API.

How to use

  1. Paste a URL (must include a scheme, e.g. https://).
  2. Read off the parts and copy any piece individually.
  3. Scan the query-params table to verify each value.

About this tool

Show

Paste any URL and see every part labelled — protocol, origin, hostname, port, path, query string and fragment — with embedded credentials shown separately and query parameters broken out as key/value rows, so duplicates and encoding mistakes are visible at a glance. It uses the browser's own WHATWG URL parser, the same one that fetch and the address bar use, which means you also see the normalisation your code will get rather than the string you typed: the host is lowercased, a default port such as 443 on https disappears, dot segments in the path are resolved away, and a non-ASCII hostname is converted to its punycode form. When a URL behaves differently from how it looks, that is usually where the difference lives.

Frequently asked questions

Why does my input fail?

URLs need a scheme. example.com/path is not parseable; https://example.com/path is. Relative paths and protocol-relative URLs (//example.com) won't parse either.

Why is port empty for https://example.com?

When the port is the protocol default (80 for http, 443 for https), URL.port is intentionally empty. The browser would still connect to 443.

Are query params decoded?

Yes. %20 shows as space, %2F as /. Copy a key or value to get the decoded form. If you need percent-encoded text, look at search instead.

Does this send the URL anywhere?

No. Parsing happens entirely in your browser via the WHATWG URL API.

The URL I pasted came back changed. Is that a bug?

No — that is the normalisation your code will get. The WHATWG parser lowercases the host, drops a default port, resolves dot segments in the path and converts a non-ASCII hostname to punycode. Seeing the normalised form is usually the point: it is what fetch, a browser and most servers will actually use.

Why is a bare example.com rejected?

Because without a scheme it is not a URL, only a string that looks like one. A parser cannot guess whether you meant https, ftp or a relative path, and guessing is how a link ends up pointing somewhere unintended. Prefix it with https:// and it parses.

Related tools