Query String ↔ JSON
Paste a query string or full URL to see its parameters as JSON, or paste JSON to build an encoded query string — instantly in your browser.
Updated
How to use Query String ↔ JSON
The Query String ↔ JSON tool turns a URL query string into clean, readable JSON and builds an encoded query string back from JSON. Paste a full URL or just the part after the question mark, and the parser splits the parameters, decodes percent-encoding, and collects repeated keys into arrays so nothing is lost. Switch direction to serialise a JSON object into a properly encoded query string. It all runs in your browser, making it a fast, private way to inspect and construct URL parameters.
- Choose "Parse" to turn a query string into JSON, or "Build" to do the reverse.
- Paste a query string or full URL (for parsing) or a JSON object (for building).
- The tool extracts the parameters after the ? automatically when you paste a URL.
- Review the JSON or encoded query string in the output panel.
- Copy the result for use in code, a REST client or documentation.
Your data never leaves your device — 100% private processing.
How query strings encode data
A URL query string begins after the ? character and consists of key=value pairs joined by &. Because many characters — spaces, ampersands, equals signs, slashes and non-ASCII letters — have special meaning or are unsafe in a URL, they are percent-encoded: each byte becomes a % followed by two hexadecimal digits, and spaces are sometimes written as +. There is no single official standard for how to represent arrays or nested structures, so conventions vary: some systems repeat a key (tag=a&tag=b), others use bracket notation (tag[]=a). This tool decodes percent-encoding on parsing, re-encodes on building, and treats repeated keys as arrays so round-tripping is lossless for the common cases.
| Raw value | Encoded | Notes |
|---|---|---|
| hello world | hello%20world | Space encoded |
| a&b | a%26b | Ampersand escaped |
| 100% | 100%25 | Percent sign escaped |
| café | caf%C3%A9 | UTF-8 bytes percent-encoded |
Handling repeated and empty parameters
Real-world URLs frequently include the same parameter more than once — for example a faceted search that sends filter=red&filter=blue. A naive parser that builds a flat object would silently drop all but the last value. This tool instead collects repeated keys into a JSON array, preserving every value and their order. Empty parameters (a key with no value, like ?debug) are represented with an empty string so they survive a round trip. When building a query string from JSON, array values are expanded back into repeated key=value pairs, reproducing the original shape so the output works against servers that expect that convention.
Worked examples
Parse a query string
Inputs: ?tag=a&tag=b&q=hello%20world
Result: { "tag": ["a", "b"], "q": "hello world" }
Build a query string
Inputs: { "page": 2, "sort": "name" }
Result: page=2&sort=name
Glossary
- Query string
- The portion of a URL after the ? character that carries key=value parameters separated by &.
- Percent-encoding
- A scheme that represents reserved or unsafe characters in a URL as a % followed by two hexadecimal digits.
- Parameter
- A single key=value pair within a query string.
- Repeated key
- A parameter name that appears more than once, typically representing multiple values for the same field.
- Serialisation
- The process of turning a structured object into a flat query-string representation.
Related reading
Frequently Asked Questions
Get weekly tool tips & updates
New tools, power-user tips, and productivity hacks — delivered free every Friday.
No spam, ever. Unsubscribe with one click.
Why use Query String ↔ JSON?
- Convert messy query strings into structured JSON you can read at a glance
- Build a correctly percent-encoded query string from a JSON object
- Repeated keys are gathered into arrays so duplicate parameters are preserved
- Accepts a full URL and extracts the query portion automatically
- Works entirely client-side — URLs and their parameters stay on your device
Common use cases
- Debug a tracking or analytics URL by viewing every parameter as JSON
- Construct a complex query string for an API request from structured data
- Inspect OAuth or redirect URLs that pack many parameters together
- Compare two URLs by converting both to JSON and diffing the objects
- Decode percent-encoded values to confirm what a link actually contains
Related Developer Tools
URL Encoder / Decoder
Encode and decode URLs and URL components online. Convert special characters to percent-encoding and back instantly — free, private, and fast.
JSON Formatter & Validator
Format, validate, and minify JSON instantly. Includes syntax highlighting, error detection, and a collapsible tree view — free, private, in-browser.
Base64 Encoder & Decoder
Encode text or files to Base64, or decode Base64 strings back to text. Fast, free, and runs entirely in your browser.
Regex Tester
Test and debug regular expressions online. See live matches, capture groups, and replace output. Free, private, instant.
HTML Encoder / Decoder
Encode and decode HTML entities online. Escape <, >, &, and quote characters for safe HTML display. Free, instant, and private — runs in your browser.
Hash Generator
Generate cryptographic hashes online. Support for SHA-1, SHA-256, SHA-384, and SHA-512. Instant, secure, client-side.
Explore all Developer Tools.