Encode · Developer

URL Parser

Split a URL into components and query parameters for debugging.

  • Protocolhttps:
  • Hostexample.com
  • Port(default)
  • Path/path/to
  • Query?foo=1&bar=two
  • Hash#section
  • Originhttps://example.com
  • foo = 1
  • bar = two

What is URL Parser?

The URL Parser breaks a URL into its components — scheme, host, port, path, query parameters, and fragment — using the browser's built-in URL API, which implements the WHATWG URL Standard. The underlying grammar of URIs is defined in RFC 3986.

Paste any URL and the tool shows each structural piece plus a table of decoded query parameters, making it easy to debug links, redirects, and API endpoints. If you omit the scheme, it assumes https:// so partial inputs still parse.

Parsing happens in your browser; nothing is uploaded.

Why Use This Tool?

Reading a long URL by eye is error-prone, especially with many query parameters, encoded values, or an embedded fragment. Decomposing it into labeled parts makes it obvious what host you are hitting and exactly which parameters are set.

  • Inspect every component of a URL at once.
  • See decoded query parameters in a table.
  • Debug redirects, tracking links, and API calls.
  • Parse partial URLs without a scheme.

How Does This Tool Work?

The tool checks whether the input begins with a scheme; if not, it prepends https:// so relative-looking hosts still parse. It then constructs a URL object, which normalizes the input and exposes protocol, username, password, hostname, port, pathname, search, hash, and origin.

Query parameters are read from the URL's searchParams, which automatically percent-decodes each key and value, and are presented as a key/value table.

Understanding Your Results

You get each component individually. The origin combines scheme, host, and port; the pathname is the path after the host; search is the raw query string (with leading ?), and hash is the fragment (with leading #). The parameter table shows decoded values, so %20 appears as a space.

If parsing fails, the string is not a valid URL even after assuming https://. Note that the WHATWG parser normalizes some inputs — for example lowercasing the host and resolving default ports — so the parsed output may differ slightly from the raw text.

Why Tracking This Matters

URLs carry routing, authentication redirects, and analytics parameters. Being able to inspect them precisely helps diagnose broken links, unexpected redirects, and misencoded parameters that would otherwise be hard to spot.

Benefits of Using URL Parser

  • Full component breakdown
  • Decoded query-parameter table
  • WHATWG-standard parsing
  • Assumes https:// for partial input
  • Reveals origin, path, and fragment
  • Runs privately in your browser

How Is the Result Calculated?

There is no math. The tool delegates to the URL constructor, which parses per the WHATWG URL Standard, and enumerates searchParams to build the parameter table. Percent-decoding of parameters is handled by the standard API.

Tips for Better Results

  • Include the scheme for the most accurate parse; otherwise https:// is assumed.
  • Use the parameter table to confirm encoded values decode as expected.
  • Remember the parser normalizes host casing and default ports.
  • Use the URL Encoder to fix parameters that look wrong.
  • The fragment (after #) is never sent to servers by browsers.

Standards and References

Conclusion

The URL Parser decomposes any URL into its components and decoded parameters using the standard browser URL API.

It is a quick, private way to debug links, redirects, and API endpoints and to confirm exactly what a URL contains.

Privacy & how it works

This developer utility runs in your browser with JavaScript and Web APIs. Your text, tokens, and secrets are not uploaded to The ToolSphere servers for this tool. Privacy Policy.

FAQ

What if the URL has no protocol?expand_more

The tool assumes https:// so inputs like example.com/path still parse. Include the real scheme when you need an exact parse of a non-HTTPS URL.

Which parsing standard is used?expand_more

It uses the browser's URL API, which implements the WHATWG URL Standard. The classic URI grammar is defined in RFC 3986.

Are query parameters decoded?expand_more

Yes. Parameters are read via searchParams, which percent-decodes keys and values, so %20 shows as a space and %26 as an ampersand.

What is the difference between origin and host?expand_more

The host is the hostname plus optional port; the origin is the scheme, host, and port combined. Origin is what browsers use for same-origin checks.

Why does the parsed URL differ from what I pasted?expand_more

The WHATWG parser normalizes input — lowercasing the host, resolving default ports, and encoding certain characters — so the output may be a canonical form of your input.

Does it show the fragment (hash)?expand_more

Yes. The part after # is shown as the hash. Note browsers do not send the fragment to servers; it is client-side only.

Can it parse credentials in the URL?expand_more

Yes. If the URL includes username:password@ before the host, those are exposed as separate fields, though embedding credentials in URLs is discouraged.

Why did parsing fail?expand_more

The string is not a valid URL even with an assumed scheme — for example it contains illegal characters or is missing a host. Check the syntax and try again.

Does it handle duplicate query keys?expand_more

Yes. searchParams preserves repeated keys, so each occurrence appears as its own row in the parameter table.

Is the URL uploaded?expand_more

No. Parsing runs in your browser via the URL API. The URL is not sent to The ToolSphere servers for this tool.

Is this tool free?expand_more

Yes. No signup and no paywall for core use.

Is my text uploaded?expand_more

No for this tool. Text stays in your browser while you work.

Suggest an improvement

Tell us what would make this tool more useful. We read every suggestion.

Feedback for: URL Parser