Flat JSON and the query component
HTTP GET requests often carry data in the query string: the substring after ? in a URL, formatted as application/x-www-form-urlencoded pairs (name=value joined by &). That layer is inherently flat—no nested objects—unlike JSON, which can nest maps and arrays.
This page converts between a single-level JSON object and that query representation (or extracts query from a pasted URL). It is a structural view of the same data, not a substitute for full URI design, OpenAPI parameter docs, or server-side validation rules.
Query strings — background
Where query strings live in a URL
scheme://host/path?query#fragment — only the query part is key=value pairs. The path identifies the resource; the query refines the request (filters, pagination, tokens). Fragments (#…) are not sent to the server in typical browser navigation. Parsers therefore strip ?… and stop at # when turning a full URL into parameters.
Encoding: +, %XX, and reserved characters
Spaces may appear as + or %20; non-ASCII and reserved characters (&, =, ?, /) are percent-encoded. Converting JSON to a query string uses URLSearchParams-style encoding on values. Converting query to JSON decodes % sequences and treats + as space, matching common web platform behavior—not every legacy server agrees on empty values or semicolon separators.
Duplicate keys and arrays
Repeated keys (tag=a&tag=b) express multi-valued parameters. Many frameworks expose them as arrays; a single occurrence stays a scalar. JSON to query reverses the pattern by emitting repeated keys for array values. There is no universal standard for nested structures in query strings—objects inside objects belong in JSON bodies or dedicated encodings (e.g. bracket notation), not implicit nesting here.
Scalar typing on parse
Query values arrive as text. Heuristics may map unquoted tokens to numbers or true/false/null when they look unambiguous; everything else remains a string. IDs with leading zeros, large integers beyond safe JSON number range, and locale-specific decimals are common reasons to keep values as strings in application code.
Where conversion fits
Client-side request assembly
A params object in JavaScript often becomes searchParams for fetch; seeing the serialized query helps compare with network traces and backend logs.
Debugging shared links
Pasting a bookmarked URL yields a JSON snapshot of parameters for tickets, tests, or diffing environment-specific links—without retyping each key.