API & HTTP

URL Parser

Paste a URL to split it into its parts and read every query parameter, decoded, with a JSON view of the parameters.

Ready. Paste a URL.

What it does

The parser uses the browser's standard URL API, the same one used by JavaScript code, so it splits addresses exactly as your application would.

The parts of a URL

  • Protocol such as https:, and the origin (protocol, host and port).
  • Host and hostname: the host includes the port when it is not the default one.
  • Path, the query string after ? and the fragment after #.
  • Query parameter values are shown percent-decoded, and + is read as a space.

If you paste an address without a scheme, such as example.com/page, https:// is assumed and you are told.

Example

Parsing this address:

https://user@example.com:8443/docs/a%20b?q=caf%C3%A9&tag=a&tag=b+c#intro

gives the following parts:

  • Protocol: https:, username: user (the password is empty and is shown as a dash).
  • Host: example.com:8443, hostname: example.com, port: 8443, origin: https://example.com:8443
  • Path: /docs/a%20b, query string: ?q=caf%C3%A9&tag=a&tag=b+c, fragment: #intro

The query parameters are shown decoded: q is café, and the repeated name tag appears twice, as a and b c (the plus sign is read as a space). In the JSON output, repeated names become an array:

{
  "q": "café",
  "tag": ["a", "b c"]
}

What happens in unusual cases

  • No scheme. example.com/page?x=1 is read as https://example.com/page?x=1, and the tool tells you that https:// was assumed.
  • Normalization. HTTPS://Example.COM:443/Path becomes https://example.com/Path: the scheme and the host name are lowercased and the default port is dropped and shown as “(default)”. The path keeps its capital letters.
  • Not a URL. http:// is reported as “This is not a valid URL.”
  • URLs without a host. mailto:ada@example.com is parsed, but there is no host and the origin is null.
  • Broken percent codes. In ?b=%ZZ the value is shown as it is, because %ZZ cannot be decoded.

Frequently asked questions

What is the difference between host and hostname?

The hostname is only the name, such as example.com. The host adds the port when it is not the default one, such as example.com:8443.

Why is the fragment not sent to the server?

The part after # stays in the browser. It is used for in-page navigation and is not part of the request that a server receives.

How do I encode or decode a value?

Use the URL Encoder and Decoder.

Is my URL uploaded?

No. It is parsed in your browser.

Privacy

This tool runs entirely in your browser. What you enter is processed on your device and is not sent to a server.

Share this tool

Your data is not included in this link.