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 world
langen
langtr

Hash 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

    Input
    https://admin:secret123@example.com:8443/api/v1/users?id=42&filter=active#top
    Output
    protocol: 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=active

    All 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

    Input
    //cdn.example.com/assets/bundle.js
    Output
    protocol: (relative — resolves against page origin)
    hostname: cdn.example.com
    pathname: /assets/bundle.js

    Protocol-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

    1. 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.

    2. 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.

    3. 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

    References & standards