Skip to content
ToolPlankDEV
Encoders & Decoders
100% In-Browser Execution

Updated:

URL Parser: Split a URL and Its Query String

Use this url parser to split a link into protocol, host, domain, port, path, query parameters and fragment. Edit or remove parameters and copy the rebuilt URL, strip tracking codes, or turn a query string into JSON. Nothing is uploaded.

Processing in browser...

Loading the tool. It runs entirely in your browser, so your data is never uploaded.

More free tools you may need next.

Quick Guide

How to use URL Parser

Simple step-by-step instructions to get the exact output you need.

  1. 01

    Paste a URL

    Paste a link into the URL box, or press Example. The parts appear as you type: protocol, host, subdomain, domain, port, path, query and fragment. If you leave out the protocol, https:// is added before the URL is read.

  2. 02

    Read and copy the parts

    Each part has its own Copy button. Path segments are listed one by one and decoded, and the query parameters are shown as name and value pairs with the percent codes already decoded.

  3. 03

    Edit the parameters

    Change a name or a value, add a parameter or delete one. The rebuilt URL at the bottom updates at once. Remove tracking deletes utm_ parameters and click IDs such as gclid and fbclid in one step.

  4. 04

    Use Bulk or Query/JSON

    Bulk takes one URL per line and gives a CSV table you can copy or download. Query/JSON turns a query string into a JSON object, or a flat JSON object back into a query string.

What a URL Parser Does

A URL parser splits a web address into its parts so you can read, check or change each one. Instead of hunting through a long link for the domain or a parameter, you get a table. The reading follows the same URL standard that browsers use, so what you see here matches what a browser would make of the link.

The tool never opens the link. It only reads the text you paste, in your browser. It cannot tell you whether the page exists or where a short link leads.

The Parts of a URL

Take the Example link. The tool reads it like this:

Text
https://shop.example.com/products/running-shoes?color=blue&size=42&utm_source=newsletter&utm_medium=email&utm_campaign=autumn_sale&gclid=Cj0KCQ#reviews

Protocol   https
Host       shop.example.com
Subdomain  shop
Domain     example.com
Path       /products/running-shoes
Query      ?color=blue&size=42&utm_source=newsletter&...
Fragment   #reviews
  • Protocol (scheme): how to talk to the server, such as https, http or ftp.
  • Username and password: optional login text before an @ sign. The tool shows the username and hides the password.
  • Host: the server name, with the port if one is given. The port is a number after a colon, such as :8080. When it is missing, the protocol's default is used.
  • Path: the location on the server, split by slashes into segments.
  • Query: everything after the question mark, a list of name and value pairs.
  • Fragment: everything after the # sign. It points to a place inside the page and is not sent to the server.

How to Get the Domain Name From a URL

To parse a URL and get the domain name, paste it and read the Domain row. For shop.example.com the domain is example.com and the subdomain is shop. For an address such as blog.example.co.uk the tool treats co.uk as the ending and gives example.co.uk as the domain.

This split uses a simple rule: the last two labels of the host, or the last three when the second-to-last is a common label such as co, com, org, net, gov or edu under a two-letter country ending. It does not use the public suffix list, so unusual endings can be split wrongly. IP addresses and localhost are shown whole.

Query Parameters: ?, &, = and Repeated Names

A question mark starts the query. An ampersand separates one parameter from the next, and an equals sign joins a name to its value. In ?color=blue&size=42 the names are color and size and the values are blue and 42.

A name can appear more than once, as in ?tag=a&tag=b. This tool keeps repeated names in their order and does not merge them. A parameter can also have no value at all, as in ?debug. In that case the rebuilt URL leaves the equals sign out until you type a value.

Values are shown decoded. In a query string a plus sign stands for a space, and a percent code such as %26 stands for one character, here the ampersand. When you edit a value the tool writes it back with the right codes, so a value that contains & or = does not break the URL. A percent code that is not valid is kept as typed and marked.

Remove UTM and Tracking Parameters

UTM parameters are labels that marketers add to a link to see where visitors come from: utm_source, utm_medium, utm_campaign, utm_term and utm_content. They do not change the page. Click IDs such as gclid, fbclid, msclkid and similar ones are added by ad and social networks for the same reason.

Remove tracking deletes the parameters that start with utm_ and a short list of well-known click and campaign IDs, and leaves everything else alone. For the Example link it removes four parameters and the clean URL is:

Text
https://shop.example.com/products/running-shoes?color=blue&size=42#reviews

The list is not complete. Some sites use their own tracking names, and a few sites need a parameter that looks like tracking. Check that the cleaned link still opens the right page before you share it.

Query String to JSON and JSON to Query String

Query/JSON converts in both directions. Paste a query string or a full URL and get a JSON object. Repeated names become a list, and every value is kept as text, because a query string has no types:

JSON
{
  "q": "url parser",
  "tag": ["a", "b"],
  "page": "2"
}

The other direction takes a flat JSON object and writes a query string: strings, numbers and booleans become values, null becomes an empty value and a list repeats the name. Nested objects are refused with a message, because a query string cannot hold them. The Example JSON gives q=url%20parser&tag=a&tag=b&page=2.

If you need to escape a JSON string for use inside another document, see JSON Escape.

Why Some Characters Look Like %20 or +

A URL may contain only a limited set of characters, so others are written as a percent sign and two hexadecimal digits. A space is %20, an ampersand is %26 and a letter with an accent takes two or more codes. In the query part of a form submission a space is often written as a plus sign instead.

The path, the query and the fragment follow slightly different rules, which is why the tool decodes each one on its own. To encode or decode a single piece of text yourself, use URL Encode and URL Decode. If you have a block of text with many links in it, URL Extractor pulls them out first, and Bulk here can then split each one.

Bulk Mode, Limits and Privacy

Bulk reads one URL per line, skips empty lines and writes a CSV with the columns url, protocol, hostname, port, path, query, fragment and error. A line that is not a valid URL gets a row with the error Not a valid URL, so row numbers still match your list. The first 10,000 lines are read.

Text
url,protocol,hostname,port,path,query,fragment,error
https://example.com/blog/post?id=7,https,example.com,,/blog/post,?id=7,,
not a url,,,,,,,Not a valid URL

Everything runs in your browser. The links you paste are not opened, fetched or sent to a server, and nothing is stored. See the Privacy Policy for details. This tool does not check redirects, shorten links or test whether a URL is reachable. For another developer helper, the Chmod Calculator builds Linux permission commands.

Frequently Asked Questions

Technical Q&A for URL Parser

Common questions about edge cases, character encoding, and privacy guarantees.

A URL has a protocol, an optional username and password, a host with an optional port, a path, a query and a fragment. For example, https://example.com:8080/a/b?x=1#top has protocol https, host example.com, port 8080, path /a/b, query ?x=1 and fragment #top.

A question mark starts the query, an ampersand separates the parameters and an equals sign joins each name to its value, as in ?name=value&other=value.

Paste the URL and read the Domain row. The tool uses the last two labels of the host, or three for endings such as co.uk, and shows the part in front as the subdomain.

They are tags such as utm_source, utm_medium and utm_campaign that tell an analytics tool where a visit came from. They do not change what the page shows, and Remove tracking deletes them.

URLs allow only some characters, so a space becomes %20 or, in form data, a plus sign. The parser decodes both so you can read the real value.

Yes. Change, add or delete a parameter and the rebuilt URL at the bottom updates. Copy URL puts it on the clipboard.

Open Query/JSON, paste the query string or a full URL and the JSON object appears. Repeated names become a list and every value is text.

Yes. Choose JSON to query string and paste a flat object. Lists repeat the name, null becomes an empty value and nested objects are refused.

The tool adds https:// before reading it and tells you it did. Values such as localhost:3000/api are handled the same way.

No. The URL is read as text by code in your browser. It is never opened or fetched, and nothing is uploaded or stored.