URL Parser

Parse URLs into constituent parts and query parameters

https://example.com/path?query=123
Loading editor...

URL Parser — Decompose & Analyze URL Components Online

Understanding the Basics

A URL (Uniform Resource Locator) is a reference to a web resource that specifies its location and the mechanism for retrieving it. Defined in RFC 3986, a URL follows the syntax: scheme://userinfo@host:port/path?query#fragment. Each component serves a distinct purpose: the scheme specifies the protocol (http, https, ftp, mailto, data, ws), the authority section contains optional userinfo (username:password), the host (domain name or IP address), and an optional port number; the path identifies the specific resource on the server; the query string (after ?) contains key=value pairs providing additional parameters; and the fragment identifier (after #) refers to a section within the resource and is processed entirely by the client browser (never sent to the server). Understanding URL structure is essential for backend routing (matching path segments to handler functions), frontend navigation (parsing query parameters for filter state), security analysis (detecting open redirects, parameter injection, subdomain takeovers), SEO (canonical URL structure, trailing slash handling), CDN configuration (cache key design), and OAuth redirect URI validation. The browser's native URL API provides reliable, standards-compliant parsing that handles internationalized domains (IDN), IPv6 addresses, and encoded characters correctly.

How to Use the Tool

  1. Paste any URL (with or without the scheme — "https://" is assumed if missing) into the input field.
  2. The URL is instantly parsed into its components: protocol, hostname, port, pathname, search (query string), hash, and full origin.
  3. The query string is further decomposed into individual key-value pairs in the Query Parameters table.
  4. Modify individual components and see the reconstructed full URL update in real time.
  5. Copy the parsed component values individually or the full decomposed structure as a JSON object.

Key Features & Specifications

  • Parses URLs using the browser's native WHATWG URL API for standards-compliant results
  • Decomposes into: protocol, username, password, hostname, port, pathname, search, hash, and origin
  • Expands query strings into a key-value table with decoded values (URL-decoded automatically)
  • Handles internationalized domain names (IDN/Punycode) and IPv6 address notation
  • URL reconstructor: modify individual fields and generate the updated URL

Frequently Asked Questions (FAQ)

Q:What is the difference between hostname and host in a URL?
hostname contains only the domain name (e.g., "example.com"). host contains the domain name plus the port number if non-default (e.g., "example.com:8080"). When the port is the default for the protocol (80 for http, 443 for https), both hostname and host return just the domain name.
Q:Why is the fragment (#section) not sent to the server?
The fragment identifier is a client-side concept: it tells the browser to navigate to a specific anchor within the retrieved document. The browser strips the fragment before sending the HTTP request to the server. This is why server-side code never sees the hash portion of a URL — it is purely a browser navigation hint.
Q:How do I correctly parse query parameters with repeated keys (arrays)?
The URL specification allows the same query key to appear multiple times (e.g., ?tag=js&tag=css). The WHATWG URLSearchParams.getAll("tag") method returns all values for a repeated key as an array. Many server frameworks automatically deserialize repeated keys into arrays.