Query String to JSON

Paste a query string — or a whole URL, which is how it usually arrives — and get readable JSON. Repeated keys become an array, because a=1&a=2 genuinely means a list and any tool that keeps just one of them is losing your data. Going the other way, you choose how arrays are written: repeated keys, bracket notation, or comma-joined, since servers disagree about which they accept. Type coercion is optional and conservative: turn it on and numbers and true/false become real types, but a leading-zero code like 007 stays a string and a long ID is not rounded into a float. Spaces are written as %20 rather than plus, which is valid everywhere rather than only in a form body. Parsing uses the browser's own URLSearchParams, so encoding edge cases behave exactly as they do in a real request.

Array formats

FormatWritten asUsed by
Repeated keya=1&a=2The default almost everywhere
Bracketa[]=1&a[]=2PHP, Rails — expresses a one-item list
Commaa=1,2Compact APIs that split on commas

When to use it

  1. Read the parameters of a long tracking URL without counting ampersands.
  2. Turn a captured request's query into JSON for a test fixture.
  3. Build a query string from a JSON object of parameters.
  4. Check how repeated or bracketed parameters are being parsed.
  5. Decode percent-encoded values to see what was actually sent.

How to Use

  1. Paste a query string or a full URL.
  2. Read the JSON, or swap the direction to build a query string.
  3. Copy the result.

Features

  1. Accepts a bare query string or a whole URL
  2. Repeated keys collected into arrays
  3. Three array formats when writing
  4. Optional, conservative type coercion
  5. %20 encoding, valid in every context
  6. Built on the browser's own URLSearchParams

FAQs

Is my URL uploaded?

No. Everything is parsed in your browser, which matters because query strings routinely carry tokens and session identifiers.

Can I paste a whole URL?

Yes. The query is taken from it and the fragment after # is dropped. A bare query string with or without a leading ? works too.

What happens to repeated keys like a=1&a=2?

They become an array. Repeated keys are legal and mean a list, so keeping only the first or last would silently discard values — a common failure in hand-written parsers.

Why does a=1 not become an array?

Because a single repeated key is indistinguishable from a plain value in that format. Use bracket notation — a[]=1 — if you need a one-item array, which is exactly the distinction brackets exist to express.

Why is 007 still a string with coercion on?

Because it is a code, not a number, and converting it to 7 destroys it. Only plain numeric forms convert, and integers beyond the safe range stay strings too, so long IDs are not silently rounded.

Why %20 instead of + for spaces?

Plus means space only in a form-encoded body. In other contexts a reader may take it as a literal plus, so a value would arrive wrong. %20 is correct in both, which makes it the safer default.

Technical Details

Parsing goes through URLSearchParams, the browser's own implementation, which means percent-decoding, plus-as-space and every encoding edge case are handled by the same code that handles real navigation rather than by a hand-written splitter that gets one of them wrong. A pasted whole URL has its query extracted and its fragment dropped, and a leading question mark is removed, because that is how a query string actually arrives from an address bar. Repeated keys are collected into an array: a=1&a=2 is legal and means a list, and every implementation that keeps only the first or last silently loses data. Bracket keys are recognised so a[]=1 yields an array even with a single value, which is the distinction a repeated-key format cannot express. Type coercion is off by default and deliberately conservative when on — only plain numeric forms and the two boolean literals convert, so a leading-zero code like 007 stays a string and a long identifier is not rounded into a float, which is the standard way this kind of tool corrupts an ID. Writing a query string, the output encodes a space as %20 rather than the plus that URLSearchParams emits: plus means space only in a form body, and in other contexts a reader may take it literally, while %20 is correct in both. Nested objects are serialised as JSON into their value rather than flattened, since there is no single agreed bracket convention and guessing would produce a string the receiving server does not parse. Everything runs in your browser.

Data & CSV Tools

Data & CSV Tools

  • Config to JSON
  • CSV Manipulator
  • Table Format Converter
  • CSV Cleaner
  • CSV Viewer
  • JSON \u21c4 TOON
  • TOML Formatter
  • JSON Deep Merge