Query to JSON

Convert a query string into formatted JSON with repeated keys preserved as arrays and empty values kept intact.

Convert a query string into JSON without rewriting parameters by hand

Paste a full URL, a raw query string, or a leading-`?` query, then review a structured JSON version side by side. Repeated keys stay preserved as arrays so you can reuse the output in apps, docs, tests, and API examples.

Input

Paste a full URL or query string to convert it into a JSON object.

Output

Your converted JSON output appears here.

JSON output
Start typing or paste a full URL or query string to see the JSON output.
Parameters: 0 Unique keys: 0 Duplicate keys: 0 Empty values: 0
Ready to convert

How to use Query to JSON

  1. Paste a raw query string or a query value that starts with a leading question mark into the input field.
  2. Review the formatted JSON output and the parameter metrics as soon as the query string is valid.
  3. Check duplicate keys and empty values before copying the JSON into docs, code samples, or tests.
  4. Use Copy JSON when the output looks right, or Sample to load a repeated-key example.
  5. Use Clear to reset the converter and start again with a blank query string.

Query to JSON examples

  • How do you convert a query string like utm_source=newsletter&utm_medium=email into JSON?

  • How do you turn repeated ref parameters into a JSON array?

  • Convert URL parameters to JSON for an API request example.

  • How do you convert query params to JSON without rewriting each key by hand?

What Query to JSON does

This tool converts a query string into a formatted JSON object that is easier to read, copy, and reuse in code samples or browser-side testing. You can use it to convert query params to JSON, turn URL parameters into JSON, and quickly inspect how repeated keys should be preserved when the same parameter appears more than once.

When Query to JSON is useful

Query to JSON is useful when you need to convert tracking parameters, callback queries, search filters, or copied URL params into a JSON shape for debugging, documentation, fixtures, or lightweight app configuration. It works well when you want a faster query string to JSON conversion than manually building the object yourself.

How repeated query keys are handled

If the same query key appears more than once, Query to JSON preserves the repeated values as an array in the final JSON output. This keeps the original parameter order visible and avoids silently dropping values from query strings like `ref=docs&ref=search`.

Query to JSON FAQs

Can I paste a query string with a leading question mark?

Yes. The tool accepts a leading `?` and removes it before converting the parameters to JSON.

What happens when the same query key appears more than once?

Repeated query keys are preserved as arrays so the JSON output keeps every value instead of overwriting earlier matches.

Are empty values removed from the JSON output?

No. Empty values stay visible so parameters such as `flag=` or `empty=` remain represented in the final JSON.

Does Query to JSON accept a full URL?

Version one is focused on raw query strings. If you need to inspect a full URL first, use URL Parser or Query String Parser and then convert the query value separately.

Related tools