Query String Parser
Parse a full URL or raw query string into readable key-value parameters, decode percent-encoded values, inspect repeated keys, and copy the result as JSON — entirely in your browser.
Query string parser
What Is a Query String Parser?
A query string parser extracts the parameters from the part of a URL after ? and displays each key and value in a readable form. It can also decode percent-encoded values and represent repeated parameters as structured data.
https://example.com/search?q=shoes&page=2 contains q = shoes and page = 2. How do I parse URL parameters? Paste the URL or the raw query; this tool lists every occurrence without uploading the string.
What Is a Query String?
In https://example.com/search?q=shoes&page=2#results, the path is https://example.com/search, the query string is ?q=shoes&page=2, and the fragment is #results. ? starts the query. & separates parameters. = separates a key from a value when a value is present. A parameter does not have to include =.
How to Use the Query String Parser
- Paste a full URL or raw query string.
- The parser extracts the query component and stops before any fragment.
- Review decoded key/value pairs in original order.
- Inspect repeated keys, empty values, and flags that have no
=. - Switch to JSON when you need an object with arrays for duplicates.
- Copy JSON, the original query, or a normalized query if you need that form.
How Query String Parsing Works
Input is classified as a full URL or a raw query. The query component is taken from URL.search when the input is a URL, otherwise from the text after an optional ?. Pairs are split on unencoded &, the first unencoded = separates key and value, then keys and values are decoded. + becomes a space when the URLSearchParams-style option is on. Repeated names stay as separate rows. JSON is a convenience view: one value stays a string; two or more become an array.
Real examples
| Input | Result |
|---|---|
| https://example.com/search?q=shoes&page=2 | q = shoes, page = 2 |
| ?name=John+Doe&city=New+York | name = John Doe, city = New York |
| tag=javascript&tag=react&tag=web | Three tag rows. JSON: {"tag":["javascript","react","web"]} |
| q=hello%20world&redirect=%2Fcheckout%3Fstep%3D2 | q = hello world, redirect = /checkout?step=2 |
| utm_source=google&utm_medium=cpc&utm_campaign=spring | Tracking parameters you can inspect; this is not campaign analytics. |
API-style: https://api.example.com/users?status=active&limit=20&offset=40&sort=name yields status, limit, offset, and sort as strings. Callback-style: https://example.com/callback?code=abc123&state=xyz is a dummy example—do not paste live OAuth codes into shared screenshots.
What Happens When a Query Parameter Appears More Than Once?
?tag=js&tag=react contains two occurrences. This parser keeps both. Languages and frameworks may collapse duplicates, last-write-win, or build arrays. Bracket forms such as tags[]=javascript are shown as the literal key tags[]; that notation is not a universal array standard. The table is the safest record of what the URL actually contained.
URL Encoding and Decoding
Spaces often appear as hello%20world or, in form-encoded queries, hello+world. / is %2F, ? is %3F, & is %26, and = is %3D. How do I decode URL parameters? The default here follows URLSearchParams: + is a space. Turn that option off if a plus must stay literal.
Query String Parser vs URL Parser
| Tool | Best for |
|---|---|
| Query String Parser | Extracting and decoding query parameters, including repeats and JSON. |
| URL Parser | Protocol, hostname, port, path, query, and fragment together. |
| URL Encoder/Decoder | Encoding or decoding a piece of URL text, not a parameter table. |
| JSON Formatter | Formatting structured JSON after you copy it from this page. |
Query String Parsing in JavaScript
URLSearchParams is the browser-native API for query strings:
const url = new URL("https://example.com/search?q=tools&page=2");
const params = url.searchParams;
for (const [key, value] of params) {
console.log(key, value);
}That logs q → tools and page → 2.
Common Uses for a Query String Parser
- Debugging API query parameters and frontend-generated search or filter URLs.
- Inspecting pagination, sort, and callback URLs during QA.
- Reading UTM and other tracking links without treating this page as analytics software.
- Converting query parameters to JSON for a ticket or a test fixture.
- Comparing raw and decoded values when a redirect looks wrong.
Common Query String Parsing Mistakes
- Splitting on
&after decoding, which can break encoded values. - Splitting on every
=instead of the first separator in a pair. - Dropping repeated keys or empty values.
- Treating a fragment as part of the query.
- Forgetting percent-decoding, or assuming
+is always a literal plus. - Assuming every framework interprets duplicates the same way.
- Reordering or re-encoding signed URLs.
- Sharing tokens or API keys that were sitting in the query.
Query string parser FAQ
What is a query string parser?
It reads the query part of a URL and lists each parameter. This one also decodes percent-encoding, keeps repeated keys, and can copy a JSON object built from those pairs.
What is a query string in a URL?
It is the substring after ? and before any # fragment. Keys and values are usually joined with = and separated with &.
How do I parse a query string?
Paste the URL or the query into the box. The table updates as you type. You do not need to strip the leading ?.
Can I paste a full URL into the parser?
Yes. The tool takes URL.search for the parameters and shows origin, path, query, and fragment in a compact panel. Full URL decomposition belongs on URL Parser.
Can I paste only the query string?
Yes. ?q=hello+world&page=2 and q=hello+world&page=2 are both accepted.
Does the parser decode URL-encoded values?
Yes. hello%20world becomes hello world, %2F becomes /, and %26 / %3D stay inside a value instead of creating extra separators.
Does it decode plus signs as spaces?
By default yes, matching URLSearchParams form encoding. Uncheck Decode + as space if a plus should stay a plus.
How are repeated query parameters handled?
Every occurrence is a table row. JSON uses a string for one value and an array when the same key appears more than once. That JSON shape is this tool’s representation, not a universal framework rule.
Can I convert query parameters to JSON?
Yes. Open the JSON view and copy it. Values remain strings; page=2 stays "2", not a number.
What happens to empty query parameters?
?foo= is an empty string with an equals sign. ?foo has no equals and is labeled as a flag. Neither is dropped.
Does the parser include the URL fragment?
No. #results is shown as fragment context and is not treated as a parameter value.
Can I use this for API debugging?
Yes, for inspecting query keys on a request URL. It does not send the request, check auth, or validate tokens.
Can I parse UTM tracking parameters?
Yes. utm_source and similar keys appear in the table like any other parameter. The page does not measure campaign performance.
Is my URL uploaded to a server?
No. Parsing runs in your browser. URLs and parameter values are not uploaded, logged, or placed in share links.
Does this query string parser work on mobile?
Yes. Use a modern mobile or desktop browser. The table scrolls inside the result area instead of forcing the whole page sideways.
What is the difference between a URL parser and a query string parser?
A URL parser splits protocol, host, path, query, and fragment. This page focuses on the query: decoding, repeats, empty values, and JSON.