URL Parser & Builder
Break any URL into its components, build URLs from parts, encode/decode, or batch-parse multiple URLs.
How to Use the URL Parser
- Parse — paste any URL to instantly see each component broken out: scheme, host, port, path segments, query parameters as a table, and hash. Each value has a copy button.
- Build — fill in individual fields and query parameter rows. The assembled URL updates in real time.
- Encode — choose Full URL (encodeURI), Component (encodeURIComponent), or Decode. Useful for handling special characters in query strings.
- Batch — paste multiple URLs, one per line. The tool extracts the host, path, and parameter count from each in a compact table.
Anatomy of a URL
A URL (Uniform Resource Locator) is defined in RFC 3986 and has the following structure:
scheme://userinfo@host:port/path?query#fragment
- Scheme — the protocol:
https,http,ftp,mailto,file - Authority — optional userinfo (
user:pass@), host, and port - Host — domain name or IP address
- Port — optional; defaults are 80 for HTTP, 443 for HTTPS
- Path — hierarchical path to the resource, separated by
/ - Query — key-value pairs after
?, separated by& - Fragment — in-page anchor after
#, processed client-side only (never sent to server)
URL Encoding
URLs may only contain a limited set of characters. Special characters must be percent-encoded: each byte is represented as %HH where HH is the hexadecimal value. JavaScript provides two encoding functions: encodeURI() encodes a complete URL, leaving structural characters like /, ?, &, and # intact. encodeURIComponent() encodes an individual value, encoding those structural characters too — use it for query parameter keys and values.
Query Strings
The query string carries data from the browser to the server. Keys and values are joined by = and pairs are separated by &. The browser API URLSearchParams parses query strings automatically and handles duplicates, empty values, and encoded characters. UTM parameters (utm_source, utm_medium, utm_campaign) are query string parameters used for marketing analytics — see our UTM Builder to create them.
Fragment Identifiers
The fragment (hash) part of a URL is never sent to the server — it is purely a client-side instruction. In traditional HTML it scrolls to an element with a matching id. In single-page applications (SPAs), the hash is used for client-side routing — changing the hash updates the URL without triggering a page reload. In contrast, the HTML5 History API (pushState) allows SPAs to use full path-based URLs while still handling navigation client-side.
Relative vs Absolute URLs
An absolute URL contains the full scheme and authority (e.g., https://example.com/page). A relative URL is resolved against a base URL: /page is relative to the origin, page is relative to the current path, and ../page navigates one level up. The browser's URL constructor resolves relative URLs: new URL('/page', 'https://example.com') returns the absolute form. This matters for canonical URLs, Open Graph tags, and sitemap entries which should always use absolute URLs.