URL Parser

How It Works

  1. Step 1: Paste any URL including API endpoints with query parameters, deep links with fragments, or complex URLs with authentication credentials and port numbers.
  2. Step 2: The parser uses the URL API to decompose the URL into protocol, hostname, port, pathname, search parameters, and hash fragments following RFC 3986 specification.
  3. Step 3: Decodes percent-encoded characters (%20, %3D, %2F) back to readable text, extracts individual query parameters as key-value pairs, and identifies URL components.
  4. Step 4: Displays parsed components in organized format showing protocol scheme, domain hierarchy, path segments, decoded query parameters, and fragment identifiers for debugging or documentation.

URL Parsing Examples

Example: Complex URL Breakdown

URL String Input
https://api.example.com:8443/v2/users/search?name=John%20Doe&age=30&sort=desc#results
Parsed Components Output
Protocol: https
Hostname: api.example.com
Port: 8443
Path: /v2/users/search

Query Parameters:
  name: "John Doe" (decoded from John%20Doe)
  age: "30"
  sort: "desc"

Fragment: results

Full Breakdown:
- Scheme: https://
- Subdomain: api
- Domain: example.com
- Port: :8443
- Path segments: ["v2", "users", "search"]
- Query string: ?name=John%20Doe&age=30&sort=desc
- Hash: #results

Key Changes:

The parser breaks down the URL into its RFC 3986 components, starting with the protocol scheme (https) which determines connection security. The hostname is decomposed into subdomain (api) and root domain (example.com) for DNS resolution understanding. The non-standard port 8443 is extracted, indicating a custom HTTPS port instead of default 443. The path /v2/users/search is segmented to show API versioning (v2) and resource hierarchy (users/search). Query parameters are decoded—%20 becomes a space in 'John Doe'—and presented as key-value pairs for easy inspection. The fragment #results identifies the in-page anchor or client-side routing target. This parsing is essential for API debugging, understanding deep link structure, and validating URL construction in web applications. Developers use this to verify query parameter encoding, check path structure, and ensure proper URL formatting before making HTTP requests.

Frequently Asked Questions

How does the parser handle URL encoding and special characters?

The parser automatically decodes percent-encoded characters using UTF-8 decoding: %20 becomes space, %2F becomes /, %3D becomes =, %26 becomes &, and %2B becomes +. It handles both application/x-www-form-urlencoded format (where + represents space in query strings) and standard percent-encoding. The parser decodes multi-byte UTF-8 sequences like %E2%9C%93 (✓ checkmark) and %F0%9F%98%80 (😀 emoji). For query parameters, it splits on & or ; delimiters, then decodes each key-value pair separately. The parser preserves the original encoded URL while displaying decoded values for readability. It also identifies improperly encoded URLs where reserved characters (: / ? # [ ] @) appear unencoded in wrong positions. This is critical for debugging API requests, analyzing tracking parameters, or extracting user input from URLs where special characters must be properly encoded to prevent parsing errors or security vulnerabilities.

Can the parser extract and validate different URL components?

Yes. The parser extracts and validates protocol (http, https, ftp, ws, wss, file, data, mailto), authentication (username:password@), hostname (domain or IP address), port (explicit or default: 80 for http, 443 for https), path (/path/to/resource), query string (?key=value&key2=value2), and fragment (#section). For hostnames, it validates domain format (subdomain.domain.tld), internationalized domain names (IDN with punycode encoding), IPv4 addresses (192.168.1.1), and IPv6 addresses ([2001:db8::1]). The parser detects invalid URLs: missing protocol, malformed domains, invalid port numbers (>65535), or conflicting components. It also extracts metadata like top-level domain (.com, .org, .co.uk), subdomain levels (www.api.example.com has 2 subdomains), and path segments (/users/123/profile splits into ["users", "123", "profile"]). This comprehensive parsing enables URL validation, security analysis, and automated URL manipulation for web scraping, API testing, or link analysis.

How does the parser handle complex query strings and arrays?

The parser handles multiple query string formats: standard key-value pairs (key=value), repeated keys for arrays (color=red&color=blue becomes color: ["red", "blue"]), bracket notation for arrays (items[]=1&items[]=2), nested objects (user[name]=John&user[age]=30 becomes user: {name: "John", age: "30"}), and empty values (key= or key with no value). It supports both & and ; as parameter separators for compatibility with different server implementations. The parser preserves parameter order and handles edge cases: duplicate keys (last value wins or array depending on format), keys without values (treated as boolean flags), and values without keys (ignored or flagged as malformed). For complex URLs like tracking pixels or analytics, it extracts dozens of parameters with encoded JSON values, base64 data, or nested structures. This makes the parser essential for debugging API requests, analyzing marketing campaign URLs with UTM parameters, or extracting data from webhook callbacks where query strings encode complex payloads.