URL Parser
Break a URL into its components and decode query parameters
URL
Components
- Protocol
- https
- Username
- user
- Password
- pass
- Hostname
- www.devtools.tools
- Port
- 8443
- Path
- /api/v1/search
- Query
- ?q=hello%20world&lang=en&lang=tr
- Fragment
- #results
- Origin
- https://www.devtools.tools:8443
Query parameters (3)
qhello worldlangenlangtrHash parameters
None
About
Break a URL into its components — protocol, host, port, path, query string, and fragment — and decode every query and hash parameter. Protocol-relative (`//host/path`) and path-only URLs are resolved against a placeholder so their structure still shows. Everything runs in your browser; nothing is uploaded.
Examples
Parse a full URL with credentials and port
https://admin:secret123@example.com:8443/api/v1/users?id=42&filter=active#topprotocol: https:
username: admin
password: (hidden — contains sensitive data)
hostname: example.com
port: 8443
pathname: /api/v1/users
search: ?id=42&filter=active
hash: #top
decoded params: id=42, filter=activeAll URL components are separated and shown; query parameters are decoded from percent-encoding so 'active' appears as 'active', not 'active'.
Parse a protocol-relative URL
//cdn.example.com/assets/bundle.jsprotocol: (relative — resolves against page origin)
hostname: cdn.example.com
pathname: /assets/bundle.jsProtocol-relative URLs are resolved against the current page's origin, so the hostname and path are still extracted correctly.
About this tool
A URL is more than just a web address — it has a precise structure defined by RFC 3986: scheme, userinfo (username and password), host, port, path, query string, and fragment. Parsing a URL correctly is essential for routing, authentication, and parameter extraction, and the browser's native URL API handles edge cases that a regex cannot.
This parser breaks any URL into its components using the browser's URL constructor. Query and hash parameters are automatically URL-decoded so you see the actual values, not the percent-encoded forms. Protocol-relative (//example.com) and path-only (/path) URLs resolve against a placeholder base so they still parse correctly.
How to use
Paste a URL
Drop any URL — https://user:pass@host:8080/path?a=1&b=2#section, a short link, a protocol-relative URL, or a path-only string — into the input.
Read the components
The tool shows protocol, username, password, hostname, port, pathname, search (raw query string), and hash, with decoded query and hash parameters listed below.
Copy a component
Click Copy next to any component to grab just that part of the URL.
Use cases
Extracting query parameters from a shared link
Paste a long shared URL and extract the individual query parameters without manual string splitting.
Inspecting a URL with credentials
Check what username and hostname are embedded in a URL without exposing the password in the main display.
Debugging redirect URLs
Paste a redirect target URL and see exactly which path, query, and hash the user will land on after a redirect.
Common mistakes
Mistake:Parsing a URL with a regex instead of the URL API.
Fix:URLs have many edge cases: IPv6 addresses in brackets, colons in the userinfo, port numbers, percent-encoded characters. A regex will break on some of these. The browser's URL constructor handles them all.
Mistake:Forgetting to decode query parameters.
Fix:Query parameters are percent-encoded (space → %20, & → %26). Copying the raw query string may include these codes. The tool decodes them so you see the actual values.
Mistake:Not handling the password field safely.
Fix:URLs with embedded passwords (user:pass@host) expose credentials in the address bar, logs, and referrer headers. Never paste such URLs into shared or logged contexts. The tool warns when a password is detected.
Frequently asked questions
Related guides
References & standards
Related tools
TOML Validator
Validate TOML and re-emit it as clean, indented JSON
TOML to JSON Converter
Convert TOML to JSON and JSON to TOML in either direction
JSON Lines Converter
Convert JSON Lines (NDJSON) to a JSON array and back
CSV to SQL Converter
Generate SQL INSERT statements from CSV data
JSON Schema Validator
Validate a JSON document against a JSON Schema
CSV to Markdown Converter
Convert CSV to a Markdown table and Markdown tables back to CSV