Parsing URL Query Strings into JSON
Query String Parsing
When to Parse Query Strings
Extract parameters from URLs, redirect chains, OAuth callbacks, and webhook logs. Paste a full URL, a query string with leading ?, or raw key=value pairs — the tool decodes values and outputs JSON.
Real-World Examples
?q=hello+world&page=2 → {"q":"hello world","page":"2"}
OAuth callback URL → inspect code and state parameters
Duplicate keys → JSON arrays: {"tag":["js","web"]}
Common Mistakes
- Expecting numeric types — all values are strings until you cast in code
- Forgetting that
+decodes to space in query strings - Parsing the hash fragment (
#...) — this tool handles the query portion only
Developer Tips
- JavaScript:
new URLSearchParams(string)for programmatic parsing - URL-decode individual values with the URL Decoder if needed
- Validate OAuth state parameter matches your session after parsing
Frequently asked questions
Are duplicate keys handled?
Yes. Duplicate keys are shown as arrays in the JSON output.
What input formats are accepted?
Full URLs with a ?query, query strings starting with ?, or raw key=value pairs separated by &. URLs and paths without a query string are rejected.
Are values automatically URL-decoded?
Yes. Percent-encoded values (%20, %2F) and + as space are decoded in the JSON output.