200 tools

Web Developer Tools · · 5 min read

How to Parse a URL Into Its Parts

Paste any URL into the URL Parser to instantly see its protocol, host, port, path, query parameters and fragment, broken out in your browser.

To parse a URL, paste it into the URL Parser — it instantly breaks the address into protocol, host, port, path, query string and fragment, lists every query parameter and path segment separately, all computed in your browser as you type.

What a URL parser does and why it matters

A URL is made of several distinct parts packed into one string — scheme, host, optional port, path, query string, fragment — and picking them apart by eye gets error-prone once query strings have several parameters or the path has several segments. A parser does that splitting mechanically: paste the full address and get back each component labeled on its own line, which is useful for debugging a redirect, checking what a tracking link actually sends, or confirming which query parameters an API call is passing.

How to parse a URL with Toolbench

  1. Open the URL Parser.
  2. Paste your URL into the Input box. There are no options to set — the tool has none, and the output updates as you type.
  3. Read the breakdown on the right: Protocol, Host, Port, Path, Query, Fragment, Origin, and Username (only shown if the URL has one).
  4. If the URL has a query string, a Query parameters list below the main breakdown shows each key and its decoded value on its own line.
  5. If the path has segments, a Path segments list numbers each one.
  6. Click Copy to grab the whole breakdown as text, or use Send to → to pass it into another tool.

Worked example

Pasting the default example — a URL with a username, a port, a query string and a fragment:

https://user@shop.example.com:8080/path/page?color=red&size=m#reviews

produces:

Protocol  https:
Host      shop.example.com
Port      8080
Path      /path/page
Query     ?color=red&size=m
Fragment  #reviews
Origin    https://shop.example.com:8080
Username  user

Query parameters (2)
  color = red
  size = m

Path segments
  1. path
  2. page

Every row lines up as label: value, so you can scan down the list without hunting through the raw string for each piece.

Example: no protocol, and a URL-encoded path

Paste a URL with no https:// and a percent-encoded character in the path:

example.com/caf%C3%A9?q=hello%20world

and the tool fills in https:// automatically (treating a bare domain as a secure URL), decodes the path segment, and decodes the query value for display:

Protocol  https:
Host      example.com
Port      (default)
Path      /café
Query     ?q=hello%20world
Fragment  (none)
Origin    https://example.com

Query parameters (1)
  q = hello world

Path segments
  1. café

Note that Query shows the raw, still-encoded string (?q=hello%20world), while the Query parameters list below it shows the decoded value (hello world) — the raw query string and the parsed parameter values aren't the same text.

URL parts reference

Part What it is Shown when
Protocol The scheme, like https: or http: Always
Host The domain or hostname Always
Port The port number, if one is specified Always — shows (default) otherwise
Path Everything after the host, before ? or #, decoded Always
Query The raw query string, starting with ? Always — shows (none) if there isn't one
Fragment The part after # Always — shows (none) if there isn't one
Origin Protocol + host + port combined Always
Username The part before @ in user@host URLs Only if present
Query parameters Each key = value pair, decoded Only if the query string has at least one parameter
Path segments Each slash-separated piece of the path, decoded, numbered Only if the path has at least one segment

Tips and common mistakes

  • Only the first line is parsed. If you paste several URLs at once, the tool reads the first non-blank line and ignores the rest — paste one URL at a time.
  • No protocol? It assumes https://. Paste a bare domain like example.com/page and the parser treats it as https://example.com/page rather than failing.
  • Query shows raw, Query parameters shows decoded. The Query row is the literal string straight off the URL; the Query parameters list below it percent-decodes each value, so a space-as-%20 in the raw query reads as an actual space in the list.
  • An invalid string throws an error. If what you paste can't be parsed as a URL even after prepending https://, the tool reports "Not a valid URL" instead of guessing.
  • A password in user:pass@host URLs isn't broken out separately. Only the username before the colon is shown as its own field.
  • Base64 / URL Encode — percent-encode a value before you drop it into a query string, or decode one you pulled out of a parsed URL.
  • Slug Generator — turn a title into the clean, hyphenated path segment a URL should use.
  • What Is My IP — look up your own public IP address and network details.
  • Text Diff — compare two URLs side by side to spot exactly what changed between them.

Frequently asked questions

Does the URL Parser send my URL to a server?

No. The URL is parsed entirely in your browser using the standard URL object — nothing is sent anywhere. If you're signed in, the input syncs privately to your account; if you're signed out, nothing is saved.

Why does the tool add "https://" to my URL?

If what you paste doesn't start with a recognized scheme like https:, http: or mailto:, the parser assumes you meant a secure web address and prepends https:// before parsing, rather than failing on a bare domain.

What's the difference between the Query row and the Query parameters list?

Query is the raw string exactly as it appears in the URL, starting with ?. Query parameters breaks that string into individual key/value pairs and percent-decodes each value, so encoded characters like %20 show as readable text.

Can I parse more than one URL at once?

No — the tool only reads the first non-blank line of whatever you paste. To parse several URLs, paste and check them one at a time.

What happens if I paste something that isn't a valid URL?

The tool tries prepending https:// first in case you left off the protocol. If it still can't be parsed, it shows "Not a valid URL" instead of a breakdown.

More guides

All guides →