What this tool converts
This tool parses a URL query string — with or without a leading ? or a full URL in front of it — into a JSON object using the browser's native URLSearchParams parser, which handles percent-decoding and + as space automatically. When a key appears more than once (?tag=a&tag=b), the tool detects the repeat and collects the values into a JSON array instead of overwriting the first one.
It accepts a bare query string (name=John&age=30), a string with a leading ? (?name=John), or a full URL (https://example.com/search?q=test) — the tool strips everything up to and including the first ? before parsing.
When to use it
Use it when debugging an incoming request, inspecting a redirect URL, or reverse-engineering what parameters a third-party API or tracking pixel expects — paste the raw query string from your browser's address bar or a server log and get a readable, structured JSON view instead of squinting at an encoded one-liner. It's also useful when writing tests: convert a real production query string to JSON once, then use that object as a fixture in code.
For the reverse direction — building a query string from a JSON object of parameters — use the companion JSON to Query String tool.
Example
Input ?name=John+Doe&age=30&tag=api&tag=backend converts to {"name": "John Doe", "age": "30", "tag": ["api", "backend"]} — the + decodes to a space, and the repeated tag key becomes an array. Note that age comes back as the string "30", not a number, since query strings have no native type information.
How to use the Query String to JSON tool
- 1
Paste a query string or URL
With or without a leading ? — a full URL works too, everything before the ? is discarded.
- 2
Click Convert
URLSearchParams decodes each key/value pair; repeated keys become arrays automatically.
- 3
Copy the JSON
The output is pretty-printed JSON ready to paste into code, tests, or documentation.
- 4
Share it
Copy a permalink to hand the exact query string to a teammate.
Frequently asked questions
Why do all my numeric values come back as strings?
Query strings have no type system — every value is text. If you need numbers or booleans, cast them explicitly after parsing (Number(obj.age), obj.active === 'true').
How are repeated keys handled?
The first occurrence of a key becomes a string; if the same key appears again, the tool converts it to an array holding both values, so ?a=1&a=2 becomes {"a": ["1", "2"]}, not just the last value.
Can I paste a full URL instead of just the query string?
Yes — the tool splits on the first ? and discards everything before it, so pasting the whole URL works the same as pasting just the query portion.
Is my data uploaded anywhere?
No. Parsing runs entirely in your browser with the native URLSearchParams API — nothing is sent to a server. See also the JSON to Query String tool for the reverse conversion.
Related on TechLogHub
Related Converter Tools
Unix Timestamp Converter with Milliseconds
Convert Unix timestamps to human-readable dates and vice versa
ENV to JSON
Convert .env files to JSON format
ENV to Docker Compose
Convert .env files to docker-compose environment snippet
JSON to Query String
Convert JSON objects to URL query strings
CSV to JSON Converter with Semicolon and Tab Delimiters
Convert CSV data to JSON array format
JSON to CSV Converter with Headers from Every Key
Convert JSON arrays to CSV format
Get the next tool before you need it
One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.

