🔒 100% private — runs in your browser, nothing is uploaded

URL Parser

Take a URL apart piece by piece — protocol, credentials, host, port, path, query parameters and fragment — then rebuild it to prove the parse.

A URL is a small structured document wearing a string’s clothing, and bugs breed in the seams: a port mistaken for part of the host, a password containing an @ sign, a query value that decodes differently than it reads. This parser takes the address apart by hand, piece by piece, so every component can be inspected — and then rebuilds the URL from those pieces as a built-in proof that the parse lost nothing. Worked example: https://user:[email protected]:8080/a/b?x=1&y=two%20words#frag breaks down as protocol https, username user, password pass, hostname example.com, port 8080, host example.com:8080, path /a/b, fragment frag, and parameters x = 1 and y = two words (decoded from two%20words) — and the rebuilt line gives back the original address character for character. A minimal https://example.com parses just as cleanly: no port, path /, and an empty parameter list.

The URL you paste stays in page memory on your device: it is never uploaded, stored or put into a link. That matters when the address carries credentials or tokens — take them out before you share a screenshot of the breakdown anywhere.

Quick answers

How do I break a URL into its parts?

Paste it and read the table: https://user:[email protected]:8080/a/b?x=1&y=two%20words#frag gives protocol https, hostname example.com, port 8080, path /a/b, fragment frag, and decoded parameters x=1 and y=“two words”.

The page then rebuilds the URL from those parts only — a matching rebuild proves the breakdown lost nothing.

How do I encode text for a URL instead?

Use the URL Encoder/Decoder at /url/ — it percent-encodes text so it can sit safely inside a URL and decodes it back. This parser page does the reverse job: it dissects an existing URL into protocol, host, path, parameters and fragment.

Dissect here, encode there; the two pages cross-link because the jobs are companions, not substitutes.

How to use

  1. Paste or type a URL. The breakdown updates as you type: protocol, username and password if present, hostname, port, the combined host, path, the raw query string and the fragment.
  2. Read the parameter table: each query parameter is listed with its value percent-decoded, so y=two%20words is shown as the value “two words” a server would actually receive.
  3. Check the rebuilt line at the bottom. The parser reassembles the URL from the parts it found; if the rebuilt address matches what you pasted, the breakdown is complete and nothing was silently dropped.
  4. For the opposite job — turning text into a safely encoded URL component — use the URL encoder at /url/ instead; this page dissects, that page encodes.

About this tool

Three details are worth knowing. First, the split points follow the grammar, not guesswork: the authority ends at the first / or ?, credentials end at the last @ (so a password may itself contain @), and the port is taken only when what follows the final colon is numeric, which keeps IPv6 literals and odd hostnames intact. Second, query values are decoded the way servers decode them — percent-escapes resolved and + read as a space — while the raw query string is also shown untouched, so you can see both forms. Third, the dissection is done with plain string handling written for this page, not by handing the address to a black box: what the table shows is exactly what the rebuild uses. For the companion job of encoding text so it can travel inside a URL, use the URL Encoder/Decoder at /url/. And a standing caution: URLs pasted here stay in page memory, but a URL containing real credentials should be treated as a credential wherever else you put it.

Frequently asked questions

How are query parameters decoded?

Percent-escapes are resolved (%20 becomes a space) and a + in the query is read as a space, matching how servers and form submissions decode query strings. The raw query is shown alongside, so an encoded value can be compared with its decoded form directly.

Why does the password split at the last @ and not the first?

Because the grammar allows @ inside a password (percent-encoded or not), while the host never contains one. Splitting credentials from the host at the last @ is the rule that keeps both halves correct.

What does the rebuilt URL prove?

That the parse was lossless. The rebuilt address is assembled only from the parsed parts — protocol, credentials, host, path, the raw query and the fragment — so if it matches your input character for character, no component was dropped or altered on the way through.

What is the difference between host and hostname here?

Hostname is the name alone (example.com); host is the hostname plus the port when one is present (example.com:8080). The distinction matters because some APIs and headers want one and some want the other.

📦 Embed this tool on your site

<iframe src="https://verystep.com/embed/url-parser/" title="URL Parser" width="100%" height="520" loading="lazy" style="border:0"></iframe>

Free to use. The embed shows a small "Powered by Verystep" link.

First time embedding? Read the step-by-step guide →

More free tools