Skip to content

URL Parser

✨ Updates as you type 0 characters

Paste a link on the left

You’ll see its protocol, host, path, query parameters and the part after #, ready to edit
Nothing to split yet

URL Parser: See and Edit Every Part of a Link

What is a URL parser?

A URL parser takes a link apart so you can read it. Long links are hard to scan: by the time you get to the fifth &, you’ve lost track of which value goes with which name. Paste the link above and you get each part on its own line, with the %20 codes turned back into normal text.

You can also change any part and get a fresh, correctly encoded link back. Swap size=large for size=small, take out the tracking bits, or fix a typo in the path, then copy the result. It all happens in your browser, and the link is never opened.

The parts of a URL

Here’s one link from a made-up cafe, with each part in its own color:

https://order.example.co.uk:8443/menu/drinks?size=large&milk=oat#reviews

PartIn this linkWhat it does
Protocol https How the browser talks to the server. https is the safe, encrypted kind.
Host order.example.co.uk The site. Here order is a subdomain, example the domain and .co.uk the ending.
Port 8443 Which “door” on the server to knock on. Usually left out: https means 443.
Path /menu/drinks Which page on the site, a bit like folders on your computer.
Query size=large&milk=oat Extra details for the page, as name=value pairs after the ?.
After # (fragment) reviews A spot on the page to jump to. It stays in the browser and never reaches the server.

A link can also carry a login before the host, as in https://sam:[email protected]/. It still works in some places, but anyone who sees the link sees the password, so the tool hides it behind dots and suggests taking it out. For the longer story of how addresses work, read What is a URL?

How to use it

Step 1 Paste a link

Paste it on the left or click Sample. The parts show up on the right straight away. Forgot the https://? You’ll get a note and an Add https:// button, because without it a browser reads example.com/menu as a file on the current site.

Got a list? Put one link on each line. You’ll get a table with one row per link, and Edit on a row opens that link on its own.

Step 2 Change any part

Every box is editable: protocol, host, port, path and the part after #. Type a space or an é and the new link at the top gets %20 or %C3%A9 in the right place. If a browser would refuse the result, like a port above 65535, a red line tells you why.

Try it: move the cafe link to a new page

Change the path from /menu/drinks to /menu/hot drinks and you get:

https://order.example.co.uk:8443/menu/hot%20drinks?size=large&milk=oat#reviews

Step 3 Edit the query parameters

Each parameter gets its own row with the value already decoded. Untick a row to leave it out for now, use the arrows to move it, or + Add a new one. Sort A to Z puts them in order, which makes two similar links easier to compare. Spaces picks how spaces are written in the rows you edit: %20 works everywhere, + is what HTML forms send.

Try it: add milk=oat milk to a coffee order

Spaces as %20:

https://example.com/order?drink=latte&size=large&milk=oat%20milk

Spaces as +:

https://example.com/order?drink=latte&size=large&milk=oat+milk

Step 4 Copy the new link

Click Copy. Switch the box to Decoded if you only want to read the link with every code turned back into text (that version may not work as a link). Undo edits takes you back to the link on the left.

Link or Decoded?

Link (paste this one):

https://example.com/menu/hot%20drinks?extra=vanilla%20syrup&city=S%C3%A3o%20Paulo

Decoded (easier to read):

https://example.com/menu/hot drinks?extra=vanilla syrup&city=São Paulo

Query parameters, explained

Everything after the ? is the query string. It’s a list of name=value pairs joined with &. This order for a coffee shop has five of them:

https://example.com/menu?drink=flat+white&size=large&extra=vanilla&extra=cinnamon&decaf
NameValue
drink flat white
size large
extra vanilla
extra cinnamon
decaf no value at all

A few things to notice. The + in flat+white is a space. extra shows up twice, which is allowed: the page gets both values, in order. And decaf has no =, so it’s a switch that’s either there or not. To put an & or = inside a value, it has to be encoded as %26 or %3D; the URL Encoder does that for single values.

Remove tracking junk before you share a link

Links from newsletters, ads and social apps often carry extra parameters that only say where you clicked. The page looks the same without them. Taking them out makes the link shorter and doesn’t pass your click history along to whoever you send it to.

Before:

https://example.com/recipes/banana-bread?serves=8&utm_source=newsletter&utm_medium=email&utm_campaign=autumn&fbclid=IwAR0abc

After Remove tracking:

https://example.com/recipes/banana-bread?serves=8

The button only removes names it knows. That’s anything starting with utm_ or hsa_, plus these: fbclid, gclid, gclsrc, dclid, gbraid, wbraid, msclkid, yclid, ttclid, twclid, li_fat_id, igshid, igsh, mc_cid, mc_eid, _ga, _gl, _hsenc, _hsmi, mkt_tok, oly_anon_id, oly_enc_id, vero_id, rb_clickid, s_cid, gad_source, srsltid, ref_src, _kx. A name like ref or id stays, since some sites need it to show the right page. If you run a site and want to add these on purpose, the UTM Builder writes campaign links for you.

How browsers resolve relative links

Inside a page, links are often written without the site name: <a href="cake.html">. The browser works out the full address from the page the link is on. If that page is https://example.com/menu/drinks/tea.html, here’s where each link goes:

hrefOpensWhy
coffee.html https://example.com/menu/drinks/coffee.html Swaps the last part of the path
./ https://example.com/menu/drinks/ The folder the page is in
../food/cake.html https://example.com/menu/food/cake.html Up one folder, then into food
/contact https://example.com/contact From the site’s root
//cdn.example.net/app.js https://cdn.example.net/app.js Same protocol, different host
?page=2 https://example.com/menu/drinks/tea.html?page=2 Same page, new query
#reviews https://example.com/menu/drinks/tea.html#reviews Same page, jump to a spot
https://example.org/ https://example.org/ Already a full URL, the base is ignored

The Resolve a link tab in the tool does this for any pair, using the browser’s own rules. It’s a quick way to find out why an image or stylesheet doesn’t load: usually one ../ too many or too few.

Links that aren’t what they look like

The tool always shows the host a browser would really open, which helps with links meant to fool you. In this one, everything before the @ is a login name, not the site:

https://[email protected]/login

The host is evil.example. A backslash is another trick: browsers treat \ like /, so https://evil.example\@good.example/ opens evil.example. And a host written with % codes, like %65vil.example, is decoded first, so it’s really evil.example. The tool adds a note in each case. It can’t tell you whether a site is safe, though. It only shows you where the link leads.

Reading URL parts in JavaScript

Browsers come with a URL parser built in. The URL class splits a link, and searchParams reads and changes the query:

const url = new URL('https://example.com/menu?drink=latte&size=large&extra=vanilla&extra=cinnamon');

url.hostname;                     // 'example.com'
url.pathname;                     // '/menu'
url.searchParams.get('drink');    // 'latte'
url.searchParams.getAll('extra'); // ['vanilla', 'cinnamon']
url.searchParams.get('milk');     // null (not there)

url.searchParams.set('size', 'small');
url.searchParams.append('milk', 'oat milk');
url.searchParams.delete('extra');
url.href;
// 'https://example.com/menu?drink=latte&size=small&milk=oat+milk'

Notice the + in oat+milk: searchParams writes spaces the way forms do. For a relative link, pass the page address as the second argument:

new URL('../food/cake.html', 'https://example.com/menu/drinks/tea.html').href;
// 'https://example.com/menu/food/cake.html'

One catch: new URL() throws a TypeError for anything that isn’t a full URL, like example.com/menu, so wrap it in try/catch when the text comes from users.

What this tool can’t do

Frequently Asked Questions

What are the parts of a URL?

Take https://shop.example.com:8443/menu/drinks?size=large#reviews. https is the protocol, shop.example.com is the host (shop is a subdomain, example the domain and .com the ending), 8443 is the port, /menu/drinks is the path, size=large is the query string and reviews is the part after #, also called the fragment or hash. Most links skip the port, because https uses 443 unless you say otherwise.

What is a query parameter?

A name and a value after the ? in a URL, like size=large in /menu?size=large. Several are joined with &, so ?size=large&milk=oat has two. The server or the page’s JavaScript reads them to decide what to show. The same name can appear more than once (extra=vanilla&extra=cinnamon), and a name can have no value at all (?debug).

Is it safe to paste a link here?

Yes. The link is split in your browser and never sent anywhere, fetched or opened. The page doesn’t save what you paste. It only remembers your settings in this browser: which tab you had open, Link or Decoded, how spaces are written, and how wide you dragged the panels. If the link has a password in it, the field is hidden behind dots until you click Show.

What are tracking parameters, and is it OK to remove them?

They’re the utm_source, utm_campaign, fbclid, gclid and similar bits that tell a site where a click came from. The page works the same without them in almost every case, so taking them out before you share a link is fine and makes it shorter. Remove tracking parameters only takes out names on a fixed list (shown on this page), so anything it doesn’t know stays.

Why does the tool show a different host than the one I see in the link?

Because it shows the host a browser would really open. In https://[email protected]/ everything before the @ is a login name, so the site is evil.example. A backslash counts as a slash in browsers, so https://evil.example\@good.example opens evil.example too. Numbers like http://3232235777 are read as an IP address (192.168.1.1). A note under the result explains each case.

How does a browser turn a relative link into a full URL?

It starts from the address of the page the link is on. A plain name like cake.html replaces the last part of the path, ../ goes up one folder, / starts from the site’s root, // keeps only the protocol, ?page=2 swaps just the query, and #reviews only changes the part after #. The Resolve a link tab does the same thing with the browser’s own rules, so you can try any pair.

How do I get query parameters in JavaScript?

Use the built-in URL class: const url = new URL(location.href); then url.searchParams.get("size") gives the value, url.searchParams.getAll("extra") gives every value of a repeated name, and url.hostname, url.pathname and url.hash give the other parts. url.searchParams.set() and delete() change it, and url.toString() gives the new link back.

Why does my link get an error about the port or host?

Browsers refuse some links outright. A port has to be a number from 0 to 65535, so example.com:99999 won’t open. A host can’t have spaces, <, >, | or a few other characters in it, and % codes in a host get decoded first (so %65vil.com is really evil.com). And a link without https:// at the start isn’t a web address at all inside a page: it’s read as a file on the same site. The tool names the problem and lets you fix that part.