FormatterHQ

URL Parser

Split any URL into its parts: scheme, credentials, host, port, path, query parameters and fragment. Parse one URL or a whole list at once.

Input TEXT
Output TEXT
Ready.

How to use the URL Parser

  1. Paste a URL, or several URLs with one per line.
  2. The parser splits each URL into its components instantly.
  3. Read the query parameters table, including repeated keys, and the decoded values.
  4. Copy the text breakdown or explore the structured result.

URL parser: the anatomy of a URL

Long URLs with tracking tags, encoded characters and many parameters are hard to read. This URL parser uses the browser's standards-compliant URL implementation (the WHATWG URL Standard) to split an address into its parts, exactly as a browser would interpret it.

https://admin:secret@shop.example.com:8443/products/desk%20lamp?color=oak&tag=new&tag=sale#reviews
└─┬─┘   └────┬─────┘ └──────┬───────┘ └┬─┘└──────────┬─────────┘ └────────────┬────────────┘ └──┬──┘
scheme   credentials       host       port          path                    query            fragment

Example output

URL           https://admin:secret@shop.example.com:8443/products/desk%20lamp?color=oak&tag=new&tag=sale#reviews
Scheme        https
Username      admin
Password      secret
Host          shop.example.com
Port          8443
Path          /products/desk%20lamp
Query string  ?color=oak&tag=new&tag=sale
Fragment      reviews

Query parameters:
  color = oak
  tag = new
  tag = sale

What each part means

  • Scheme – the protocol, such as https, ftp or mailto.
  • Username and password – rarely used today and a security risk in shared links, since credentials in URLs end up in logs and browser history.
  • Host – the domain name or IP address. Internationalized domain names are shown in their Punycode form (xn--…).
  • Port – shown when explicitly set; otherwise the default port for the scheme (80 for HTTP, 443 for HTTPS) is noted.
  • Path – the resource on the server. The structured result also lists the decoded path segments, so desk%20lamp reads as "desk lamp".
  • Query – key/value parameters after ?. Values are percent-decoded, and repeated keys such as tag are kept in order and grouped into an array.
  • Fragment – the part after #. Browsers never send it to the server; it is used for in-page anchors and client-side routing.

Why parse URLs instead of reading them?

Encoded characters hide what a parameter really contains: %2F is a slash, %3D an equals sign and %26 an ampersand. A parser decodes each part in the correct context, so you can tell whether an ampersand separates two parameters or is part of a value.

Useful for

  • Debugging OAuth redirects, payment callbacks and deep links with long parameter lists.
  • Reviewing marketing links to check utm_ parameters before a campaign goes out.
  • Understanding API request URLs copied from browser developer tools.
  • Checking a batch of URLs from a spreadsheet or log file: paste up to 100 at once.

Absolute, relative and special URLs

The parser expects absolute URLs. Relative references such as ../images/logo.png only make sense together with a base address, so paste the full URL instead. Special schemes work too: mailto:team@example.com?subject=Hi shows the address as the path and the subject as a query parameter, and file:///C:/docs/report.pdf shows a local file path.

Hostnames are also normalized: uppercase letters become lowercase and default ports are dropped from the canonical form, which is why the parsed URL can look slightly different from what you pasted while still pointing to the same resource.

Edge cases handled

If you paste an address without a scheme, such as example.com/path, it is parsed as http:// and a note says so. Invalid URLs produce a clear error. A + in the query is decoded as a space, following the form-encoding rules browsers use.

Related tools

Need to build or fix encoded values? Use the URL encoder and URL decoder. To strip redirect wrappers and tracking parameters from links, try the un-Google link tool. Parsing happens in your browser; URLs are not sent anywhere.

URL parser in Python

urllib.parse.urlsplit() breaks a URL into scheme, network location, path, query and fragment, and parse_qs() turns the query string into a dictionary. Three details trip people up. netloc still contains the credentials and the port, so read hostname and port instead. The path comes back as written, so call unquote() to turn %20 into a space. And a URL without a scheme, such as shop.example.com/products, is parsed as a path with an empty host; add https:// before parsing it.

from urllib.parse import urlsplit, parse_qs, unquote

url = "https://admin:secret@shop.example.com:8443/products/lamps/desk%20lamp?color=oak&size=m&tag=new&tag=sale#reviews"
parts = urlsplit(url)

print(parts.scheme)                    # https
print(parts.netloc)                    # admin:secret@shop.example.com:8443
print(parts.hostname, parts.port)      # shop.example.com 8443
print(parts.username, parts.password)  # admin secret
print(parts.path)                      # /products/lamps/desk%20lamp
print(unquote(parts.path))             # /products/lamps/desk lamp
print(parts.query)                     # color=oak&size=m&tag=new&tag=sale
print(parts.fragment)                  # reviews

params = parse_qs(parts.query)         # every value is a list
print(params)                # {'color': ['oak'], 'size': ['m'], 'tag': ['new', 'sale']}
print(params["color"][0])    # oak

Paste a URL above to see the same parts side by side and confirm what your code should return.

Frequently asked questions

How are repeated query parameters handled?
Every occurrence is kept in order. In the parameters list each one appears on its own line, and in the structured result repeated keys are grouped into an array.
Are encoded characters decoded?
Yes. Query values, path segments, credentials and the fragment are percent-decoded, so %20 is shown as a space. The original encoded path is shown as well.
What happens if my URL has no https:// prefix?
The parser assumes http:// so it can still split the address, and it adds a note that the scheme was assumed.
Why is the fragment not sent to the server?
By design, browsers keep everything after the # on the client side. It identifies a position or state within the page, so servers never see it in requests.
Can I parse many URLs at once?
Yes. Paste one URL per line and up to 100 are parsed together, each with its own breakdown.

Last updated October 3, 2026

Related tools

Cron Expression Parser Translate cron expressions into plain English and list the next 10 run times. Supports macros, seconds fields and Quartz syntax. User Agent Parser Parse user agent strings to identify browser, version, rendering engine, operating system, device type and bots. JSON URL Decode Decode a URL-encoded JSON string back into readable JSON and pretty-print it. JSON URL Encode URL-encode JSON so it can be sent as a query-string parameter or form field without breaking the URL. URL Decode Decode percent-encoded URLs and query strings back into readable text, with full UTF-8 support. URL Encode Percent-encode text or URLs online so they can be used safely in query strings, paths and form data. vCard QR Code Generator Put your contact details in a vCard QR code for business cards and badges: name, company, phone, e-mail, website and address. What Is My Screen Resolution? See your screen resolution, browser viewport size, device pixel ratio, colour depth and media-query features instantly. WhatsApp Link Generator Create a wa.me click-to-chat link with a pre-filled message for your website, e-mail signature or QR code. Wi-Fi QR Code Generator Make a Wi-Fi QR code so guests can join your network by scanning — SSID, password and security type, printable PNG or SVG. API Tester (REST Client) Send GET, POST, PUT, PATCH and DELETE requests to REST APIs from your browser and inspect status, headers and pretty-printed JSON. Barcode Generator Generate Code 128, EAN-13, UPC-A, Code 39, ITF-14, ISBN, Data Matrix, PDF417 and more barcodes. Download PNG or SVG for free.