Query String Builder & Parser
Build URL query strings from key-value pairs or paste any URL to instantly extract its parameters into a readable table. Everything runs client-side using the URLSearchParams API - your data never leaves your browser.
Try These Examples
- Parse:
?page=1&sort=name&order=asc&filter=active&search=hello+world - Parse:
https://example.com/api/users?role=admin&status=active&limit=50&offset=200 - Parse:
?q=hello%20world&lang=en&safe=off&tbm=isch
How It Works
A URL query string is the portion of a web address that follows the ? character. It consists of one or more key-value pairs separated by & characters. For example, in https://example.com/search?q=javascript&page=2, the query string is q=javascript&page=2, which contains two parameters: q with a value of javascript and page with a value of 2.
The URLSearchParams API
This tool uses the browser's built-in URLSearchParams API to parse and construct query strings. When parsing, it splits the string on & delimiters and decodes each key and value. When building, it properly encodes special characters so the resulting query string is safe to use in a URL. This means you don't need to manually call encodeURIComponent() or worry about escaping rules.
Percent-Encoding
Characters that have special meaning in URLs - such as &, =, ?, #, and spaces - must be percent-encoded when they appear inside parameter values. A space can be encoded as %20 or + (both are valid in query strings). The URLSearchParams API handles this automatically: it encodes values when building and decodes them when parsing, so you always see the human-readable form in the output.
Duplicate Keys
The URL specification allows the same key to appear multiple times in a query string, like ?color=red&color=blue. This is commonly used for arrays or multi-select filters. The URLSearchParams API preserves all occurrences, and this tool displays every one of them in the parsed output.
Frequently Asked Questions
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 (&), like ?page=1&sort=name. Query strings are used to pass data to a server or client-side application, such as search terms, pagination info, or filter settings.
How does URL encoding work in query strings?
Special characters in query string values must be percent-encoded so they don't break the URL structure. For example, a space becomes %20 or +, an ampersand becomes %26, and an equals sign becomes %3D. The URLSearchParams API handles this encoding and decoding automatically, so you don't need to worry about it.
Can a query string have duplicate keys?
Yes. The URL specification allows multiple parameters with the same key, like ?color=red&color=blue. The URLSearchParams API supports this through methods like getAll(), which returns an array of all values for a given key. This tool displays every occurrence, including duplicates.
What is the URLSearchParams API?
URLSearchParams is a built-in browser API that provides methods to work with query strings. It can parse a query string into individual parameters, build a new query string from key-value pairs, and handle percent-encoding automatically. It is supported in all modern browsers and is the recommended way to manipulate query strings in JavaScript.