Anatomy of a URL
https://user:pass@shop.example.com:8443/products/mugs?color=blue&size=M#reviews
| Part | Example | Notes |
|---|---|---|
| Scheme | https |
How to reach the resource. Case-insensitive. |
| User info | user:pass |
Optional credentials before @. Deprecated in browsers; never put a real password here. |
| Host | shop.example.com |
Domain name or IP address. IPv6 goes in brackets: [::1]. |
| Port | 8443 |
Optional. Defaults to 443 for https and 80 for http. |
| Path | /products/mugs |
Which resource. Case-sensitive on most servers. |
| Query | ?color=blue&size=M |
Key=value pairs separated by &. Keys can repeat. |
| Fragment | #reviews |
A position in the page. The browser keeps it; it is never sent to the server. |
Parse URLs in code
// JavaScript: read and edit query parameters
const url = new URL('https://shop.example.com/search?q=mug&size=M&size=L');
url.searchParams.get('size'); // "M" (first value only)
url.searchParams.getAll('size'); // ["M", "L"]
url.searchParams.set('page', '2');
url.searchParams.delete('size');
url.toString(); // "https://shop.example.com/search?q=mug&page=2"
# Python: parse_qs keeps repeated keys as lists
from urllib.parse import urlsplit, parse_qs, urlencode
parts = urlsplit('https://shop.example.com/search?q=coffee+mug&size=M&size=L')
parse_qs(parts.query) # {'q': ['coffee mug'], 'size': ['M', 'L']}
urlencode({'q': 'coffee mug'}) # 'q=coffee+mug'
Note that new URL() normalizes what it reads: it lowercases the host, converts international domains to
punycode and percent-encodes spaces. This tool keeps the URL exactly as written unless you change a part.
To encode or decode a single value, use URL Encode / Decode. To turn a request into code, paste it into the cURL converter.
Frequently asked questions
How do I get the query parameters from a URL?
Paste the URL above. Every parameter is listed with its decoded key and value, in order, including repeated keys like size=M&size=L. The raw text from the URL is shown underneath when it differs, and you can copy them all as JSON.
Can I edit the URL here?
Yes. Change any part or parameter and the URL updates as you type; edit the URL and the fields update. You can add, remove and reorder parameters, sort them, or strip tracking parameters, then copy the result. Parameters you don’t touch keep their original encoding.
Should spaces be %20 or + in a query string?
Both mean a space in a query string: + comes from HTML form encoding and %20 from URL encoding. Most servers accept either. In the path, only %20 is a space; a + there is a literal plus sign. The Spaces option controls how new and edited values are encoded.
What are utm_source, fbclid and gclid?
Tracking parameters added by marketing tools: utm_* tags name the campaign, fbclid and gclid are click IDs from Facebook and Google Ads. They don’t change the page, so Remove tracking gives you a clean link to share.
What happens to repeated query keys?
It depends on the server. Express, Django (getlist), Go and Python’s parse_qs give you all values; PHP keeps only the last one unless the key ends in [] (size[]=M&size[]=L); URLSearchParams.get returns the first. Avoid repeating keys unless the API expects it.