Query String Builder
Visually build and parse URL query strings β add, edit, and remove parameters with ease.
No parameters added yet.
About this tool
A query string builder is an essential tool for anyone working with URLs and web APIs. It simplifies the process of constructing and parsing URL query parameters by providing a visual, interactive interface instead of manually typing ampersands and equals signs. Whether you're testing an API endpoint, generating shareable links, or debugging web requests, this tool eliminates the tedium and reduces syntax errors.
Using the tool is straightforward: add parameter names and values through a form interface, and watch the complete query string update in real time. You can easily edit or remove parameters as needed, and copy the final URL to paste into your browser, API client, or code. The tool also works in reverse, allowing you to paste an existing query string to break it down into individual parameters for inspection or modification.
Frequently Asked Questions
Code Implementation
from urllib.parse import urlencode, urlparse, parse_qs, urljoin
# Build a query string from a dict
params = {
"q": "hello world",
"lang": "en",
"page": "2",
"filter": "price>100&color=red", # special chars auto-encoded
}
qs = urlencode(params)
print("Query string:", qs)
# q=hello+world&lang=en&page=2&filter=price%3E100%26color%3Dred
# Append to a base URL
base_url = "https://example.com/search"
full_url = f"{base_url}?{qs}"
print("Full URL: ", full_url)
# Parse a query string back to a dict
parsed = parse_qs("q=hello+world&lang=en&page=2")
print("Parsed: ", parsed)
# {'q': ['hello world'], 'lang': ['en'], 'page': ['2']}
# Parse an existing URL
url = "https://example.com/search?q=test&page=1#results"
parts = urlparse(url)
params_back = parse_qs(parts.query)
print("Params from URL:", params_back)Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.