Web Tools

Query → JSON

All tools

Flip between a=1&b=2 and a JSON object in either direction.

How it works

Four simple steps

1

Pick a direction

Choose Query → JSON or JSON → Query.

2

Paste the input

A query string, a full URL or a flat JSON object.

3

Read the output

Values are decoded or encoded as you type.

4

Copy or save

Copy the result or download it as a file.

Query → JSON

About Query → JSON

You are writing a test for a search endpoint, and the reference request is a browser URL with a dozen filters. Turning that query into JSON gives you something to paste into a fixture, edit, and convert back when the test needs a real URL again.

Choose a direction with the two radio buttons. In Query → JSON mode you can paste a bare query (a=1&b=hello%20world) or a full URL; everything after the question mark is decoded with URLSearchParams and printed as an indented JSON object. In JSON → Query mode, paste a flat object and the tool returns an encoded query string ready to go after a "?". The output updates as you type.

The conversion is deliberately flat. Every value comes out as a string, so page=2 becomes "2" rather than a number, and a repeated key keeps only its last value. Going the other way, arrays are joined with commas and nested objects turn into the literal text [object Object], so flatten nested data first. Strip any #fragment from a pasted URL as well, because it is not separated out and ends up attached to the last value. To inspect the rest of the address, use the URL parser, and to tidy or validate the JSON side, open the JSON formatter.

Both directions use the standard URLSearchParams API inside this page, and nothing is uploaded.

Keyboard shortcut

Ctrl Enter - Run tool
FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

Only the last value survives, because a JSON object cannot hold the same key twice. If you need every value, keep the original query string or split the values out by hand.

Query strings carry text only, so the converter does not guess types. Convert page or limit values to numbers yourself if your code expects them.

No. Nested objects are not expanded into names like filter followed by a bracketed field. Write the full bracketed name yourself as a flat JSON key and it will be encoded correctly, brackets included.

View more FAQs

Related tools

View all

A11y Annotator

Audit HTML for alt text, labels, headings, and ARIA gaps with fix suggestions.

Open

Bundle Size Estimator

Compare approximate gzip sizes for popular npm packages offline.

Open

Import Cost Estimator

Estimate approximate import cost from pasted import lines and package names.

Open

URL Parser

Break down any URL into parts.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools