Home/ Glossary/ URL Parser
Analyse

URL Parser

The URL parser breaks down any URL into its constituent components — protocol, username, password, hostname, port, path, query string parameters, and fragment identifier — and displays each part in a structured table. It also URL-decodes percent-encoded values for readability. This is useful for debugging API calls, inspecting tracking parameters, and understanding URL structure.

What is the URL Parser?

The URL parser is a tool that splits a URL according to the RFC 3986 URL specification and presents each component separately. A URL can contain up to seven components: scheme (protocol), authority (userinfo, host, port), path, query, and fragment. The query string is further parsed into individual key-value pairs. Percent-encoded characters in any component are decoded to their original form for readability. The tool handles both simple HTTP URLs and more complex ones containing credentials, non-standard ports, and deeply nested paths.

How does it work?

Paste a URL into the input field. The tool uses the browser's built-in URL API (or a polyfill) to parse the URL according to the WHATWG URL standard and extracts each component. Query parameters are split on & and each key-value pair is percent-decoded and displayed in a table. If the URL contains a fragment (#anchor), it is shown separately. Any parsing errors (e.g., invalid protocol or missing host) are reported with an explanation.

Typical Use Cases

  • Inspecting the query parameters of a complex analytics or tracking URL
  • Debugging an OAuth redirect URL by examining each parameter
  • Verifying that a URL's path and query string are correctly encoded
  • Understanding the structure of a webhook callback URL

Step-by-step Guide

  1. Step 1: Paste the URL you want to parse into the input field.
  2. Step 2: Review the component breakdown: protocol, host, path, query, fragment.
  3. Step 3: Inspect the query parameter table for decoded key-value pairs.
  4. Step 4: Copy individual components for use in your code or configuration.

Example

Input
https://api.example.com/v2/users?sort=asc&filter=active#top
Output
Protocol: https | Host: api.example.com | Path: /v2/users | Query: sort=asc, filter=active | Fragment: top

Tips & Notes

  • Fragment identifiers (#) are not sent to the server — they are processed entirely by the browser.
  • URL parameters with the same key multiple times (e.g., tag=a&tag=b) should be treated as arrays — verify your parser handles this.
  • Always decode query parameters server-side before using them — double-encoding bugs are common when parameters are re-encoded.

Frequently Asked Questions

What is the difference between a URL, URI, and URN?
A URI (Uniform Resource Identifier) is the general concept. A URL (Uniform Resource Locator) is a URI that specifies how to locate a resource using a protocol. A URN (Uniform Resource Name) identifies a resource by name without specifying its location. In practice, 'URL' is used colloquially for both.
Why do some URLs have both path segments and query parameters?
Path segments are used for hierarchical resource identification (e.g., /users/123), while query parameters carry additional filtering or configuration options (e.g., ?format=json). REST API design conventions determine which approach to use for a given parameter.
URL Parser
Break a URL down into its individual components — protocol, host, path, query parameters, fragment, and more.
Open Tool