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
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
Get weekly tool tips & updates
New tools, power-user tips, and productivity hacks — delivered free every Friday.
No spam, ever. Unsubscribe with one click.
Related Developer Tools
XML Sitemap Generator
Generate a valid XML sitemap for your website. Add your URLs, set change frequency and priority, then download the sitemap.xml.
.env ↔ JSON Converter
Convert a .env (dotenv) file to JSON, or JSON to .env. Handles quoted values, comments and export prefixes. Runs privately in your browser.
HTML Table Generator
Build clean, semantic HTML tables visually. Set rows and columns, fill cells, toggle a header row, and copy ready-to-use HTML — free and in your browser.
Table to HTML Converter
Paste CSV, TSV, or spreadsheet data and convert it to a clean HTML table instantly. Choose a delimiter and header row, then copy the markup — free and private.
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.
Explore all Developer Tools.