Skip to main content
ToolsHub

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

Files never leave your browser

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.

  1. Choose "Parse" to turn a query string into JSON, or "Build" to do the reverse.
  2. Paste a query string or full URL (for parsing) or a JSON object (for building).
  3. The tool extracts the parameters after the ? automatically when you paste a URL.
  4. Review the JSON or encoded query string in the output panel.
  5. 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.

Query string encoding examples
Raw valueEncodedNotes
hello worldhello%20worldSpace encoded
a&ba%26bAmpersand escaped
100%100%25Percent sign escaped
cafécaf%C3%A9UTF-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

Free · No spam

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

Explore all Developer Tools.