Skip to content
🛠️ToolsShed

URL / URI Parser

Parse any URL into protocol, host, path, query parameters, and hash.

About this tool

A URL or URI (Uniform Resource Identifier) is the web address you type into your browser, but it contains much more than meets the eye. Every URL is composed of several meaningful parts—protocol, host, path, query parameters, and fragments—each serving a specific purpose in how your browser locates and requests resources. Understanding these components is essential for developers, security professionals, and anyone working with web technologies who needs to parse, validate, or analyze URLs programmatically.

This parser tool breaks down any URL into its constituent parts and displays them in an organized table, making it easy to see exactly what each component is. Simply paste or type a URL, and the tool instantly separates the protocol (http/https), hostname, port, path, individual query parameters, and fragment (anchor). It's especially useful when debugging API requests, analyzing web traffic, understanding redirect chains, or working with URL rewriting rules in web servers.

One powerful feature is the ability to copy each parameter individually—useful when you need to extract a single query parameter without manually searching through a long URL. The tool handles edge cases like URLs with special characters, multiple query parameters with the same name, and URLs with non-standard ports, making it a reliable reference for web development and system administration tasks.

Frequently Asked Questions

Code Implementation

from urllib.parse import urlparse, parse_qs, urlencode, quote

url = "https://user:pass@example.com:8080/path/to/page?foo=1&bar=two&bar=three#section"

parsed = urlparse(url)
print(parsed.scheme)    # https
print(parsed.netloc)    # user:pass@example.com:8080
print(parsed.hostname)  # example.com
print(parsed.port)      # 8080
print(parsed.path)      # /path/to/page
print(parsed.query)     # foo=1&bar=two&bar=three
print(parsed.fragment)  # section

# Parse query string into dict (lists for repeated keys)
params = parse_qs(parsed.query)
print(params)  # {'foo': ['1'], 'bar': ['two', 'three']}

# URL-encode a value
encoded = quote("hello world & more")
print(encoded)  # hello%20world%20%26%20more

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.