SEO URL Tools

Free URL Parser Online

Break down any web address into its exact components: protocol, domain, port, path, query parameters, and fragment. Extract variables instantly.

Enter URL to Parse

What Is a URL Parser?

A URL Parser is a tool that takes a full internet address (a Uniform Resource Locator) and breaks it down into its constituent parts. Because URLs can be massive strings full of tracking variables, encoded characters, and complex paths, a parser helps developers read, debug, and extract the exact parameters they need accurately.

The 6 Parts of a URL

1. Protocol (Scheme)

Indicates how the browser and server should communicate. https:// is secure and encrypted, while http:// is plain text. Other protocols include ftp:// for file transfers and mailto: for emails.

2. Domain (Hostname)

The actual name of the website, like example.com. This resolves to the server's IP address. It includes the Top Level Domain (TLD) like .com or .org, and potentially a subdomain like api.example.com or www.example.com.

3. Port

Usually hidden. HTTPS defaults to port 443 and HTTP to 80. If you are running a local development server, you often see explicit ports likelocalhost:3000 or localhost:8080.

4. Pathname

Provides the exact location of the file or page on the server. For example:/blog/what-is-a-url-slug. The path begins after the domain and ends before any question marks or hash symbols.

5. Query String (Search Parameters)

Begins with a question mark (?). It passes data to the server as key-value pairs separated by ampersands (&). For example, ?id=123&lang=en. Often used for search terms, filter options, and marketing tracking (UTM tags).

6. Fragment (Hash)

Begins with a hash (#). This part is never sent to the server. The browser uses it to scroll the user to a specific ID on the page, or modern single-page applications use it for client-side routing.

Parsing URLs in JavaScript (Node.js & Browser)

Modern JavaScript has an excellent built-in URL interface that makes parsing safe and reliable. Avoid using Regex to parse URLs, as the edge cases are infinite.

const myUrl = new URL('https://example.com/search?q=shoes&size=10#results');

console.log(myUrl.hostname); // "example.com"
console.log(myUrl.pathname); // "/search"

// Extracting a specific query parameter
console.log(myUrl.searchParams.get('q')); // "shoes"

// Iterating all query parameters
myUrl.searchParams.forEach((value, key) => {
  console.log(key, value);
});

Frequently Asked Questions

What are the parts of a URL?

A URL has six main parts. The protocol (https or http) defines how data is transferred. The domain (example.com) identifies the website. The port (optional, e.g. :8080) specifies a network port. The path (/blog/post) points to a specific page. The query string (?id=42) passes parameters to the server. The fragment (#section) points to a specific part of the page.

What is a URL query string?

A query string is the part of a URL that comes after the question mark (?). It contains key-value pairs separated by ampersands. For example in ?id=42&lang=en, there are two parameters: id with value 42 and lang with value en. Query strings pass data to the server or to JavaScript on the page.

What is a URL fragment?

A URL fragment is the part after the hash symbol (#). For example in https://example.com/page#section2, the fragment is section2. Fragments tell the browser to scroll to a specific element with that id on the page. Fragments are never sent to the server and are processed entirely by the browser.

How do I parse a URL in JavaScript?

Use the built-in URL constructor: const url = new URL('https://example.com/path?key=value'). Then access url.hostname, url.pathname, url.searchParams, url.hash, and url.protocol. To get a specific query parameter: url.searchParams.get('key'). To loop all parameters: url.searchParams.forEach((value, key) => console.log(key, value)).

Local Processing
End-to-End Encryption
Works Offline

Building Something Beyond This Tool?

We help teams design and build reliable web and mobile applications backed by well-structured APIs.