The Parts of a URL Explained (With a Diagram-Style Example)

We type and click web addresses all day, but few people know what each piece does. Understanding the parts of a URL helps you build clean links, set up tracking for campaigns, troubleshoot websites and – importantly – spot fake links in scam messages. Here is every component explained using one example.

Screenshot of the URL Parser on Assen Tools
The URL Parser in use. Open the URL Parser – free, no sign-up.

One example, every part

https://shop.example.com:8080/products/shoes?color=black&size=42#reviews

Let us take it apart.

1. Protocol (scheme): https://

The protocol tells the browser how to communicate. https means the connection is encrypted. Plain http is not – browsers mark it "Not secure". Other schemes include mailto: and tel: for email and phone links.

2. Subdomain: shop

A subdomain is an optional prefix that creates a separate section of a site, such as shop., blog. or mail.. The familiar www is also technically a subdomain.

3. Domain name: example

This is the name you register and pay for each year. Together with the top-level domain it forms the identity of the website.

4. Top-level domain (TLD): .com

The ending after the last dot. Generic TLDs include .com, .org and .net; country codes include .ng (Nigeria), .uk and .gh. Newer TLDs include .app and .tech.

5. Port: :8080

A port number specifies a "door" on the server. It is almost always hidden because browsers use 443 for HTTPS and 80 for HTTP automatically. You mainly see ports in development, such as localhost:8000.

6. Path: /products/shoes

The path points to a specific page or resource on the site, often organised like folders. Short, readable paths are better for users and SEO – see what is a URL slug.

7. Query string: ?color=black&size=42

The query string starts with ? and holds parameters as name=value pairs separated by &. It is used for:

  • Search terms and filters
  • Sorting and pagination
  • Campaign tracking such as utm_source=whatsapp&utm_campaign=sale

Special characters in values must be percent-encoded – see what is URL encoding. Parameters can also create duplicate versions of a page, which is why canonical tags matter – read what is a canonical URL.

8. Fragment: #reviews

The fragment (or anchor) jumps to a section of the page. It is never sent to the server, so it does not create a separate page for search engines.

Spotting fake links

Scammers rely on people not reading URLs carefully. The real domain is always the part immediately before the TLD, just before the first single /.

  • https://paypal.com.secure-login.xyz/ – the real domain is secure-login.xyz, not PayPal.
  • https://www.gtbank-verify.com – not your bank's real domain.

Always check the domain before entering passwords or payment details.

Break down any link

The free URL Parser splits any address into protocol, host, port, path, decoded query parameters and fragment, so you can inspect tracking links, debug redirects or check suspicious URLs.

Related tools:

Frequently asked questions

Is URL the same as domain? No. The domain is one part of the URL. A URL is the complete address of a specific resource.

Are URLs case-sensitive? The domain is not, but the path and query can be on many servers. Use lower case to be safe.

Do UTM parameters affect SEO? They can create duplicate URLs, so use canonical tags and avoid UTM links in your own internal navigation.

Summary

The parts of a URL are the protocol, optional subdomain, domain name, TLD, optional port, path, query string and fragment. Knowing them helps you build clean links, track campaigns properly and spot fake addresses. Inspect any link with the free URL Parser.

Jonathan Nwachukwu, founder of Assen Tools

Written by

Jonathan Nwachukwu · Founder & developer

Jonathan is a freelance web developer and web development teacher who builds Laravel, WordPress and WooCommerce sites for clients. He built AssenTools to put the everyday file, photo and calculation jobs he kept doing for clients and students into one free, private toolbox, and he maintains every tool and guide on the site.