Skip to content
DevToolKit

Query Params to JSON

Parse URL query parameters into structured JSON with nested keys, array detection, and bi-directional conversion.

Query → JSON

Query Params Parser

Configuration

Bracket Nestinguser[name]=john → nested
Dot Nestinguser.name=john → nested
URI Decode%20 → space, + → space
Quick Examples
Pro Tip

Paste a full URL — the tool automatically extracts the query string after the ? and strips any #fragment.

Query String / URL
JSON Output
Was this tool helpful?

How to Use

Convert URL query parameters into structured JSON objects, or convert JSON back into query strings. Supports nested keys, multiple array formats, and automatic URI decoding.

  1. Paste input: Enter a full URL, a raw query string (with or without the leading ?), or a JSON object depending on the conversion direction.
  2. Configure parsing: Enable bracket nesting for keys like user[name], dot nesting for user.name, and select the array detection format (repeat, bracket, index, or comma).
  3. Read the output: The structured JSON or query string appears instantly in the output panel. All URI-encoded characters are decoded by default.
  4. Swap direction: Click "Swap Mode" to reverse the conversion. The current output becomes the new input automatically.
  5. Copy the result: Use the copy button to grab the output for use in your code, API client, or documentation.

About This Tool

Query String Parsing Standards

URL query strings follow RFC 3986, where parameters are key-value pairs separated by ampersands (&) after the question mark (?). The standard URLSearchParams API only handles flat key-value pairs, but real-world frameworks extend this significantly. Express.js, Rails, and PHP all support bracket notation (user[name]=John) for nested objects and arrays. This tool parses all these formats into clean, structured JSON without requiring any server-side framework.

Array Format Differences

There is no single standard for representing arrays in query strings, which is why this tool supports four formats. The repeat format (color=red&color=blue) is used by standard HTML forms and URLSearchParams. The bracket format (color[]=red) is the PHP and Rails convention. The index format (color[0]=red) provides explicit ordering. The comma format (color=red,blue) is common in REST APIs. Each produces identical JSON output: {"color": ["red", "blue"]}.

URI Encoding and Decoding

Special characters in URLs must be percent-encoded per RFC 3986: spaces become %20 (or + in form submissions), ampersands become %26, and non-ASCII characters like emoji are encoded as UTF-8 byte sequences. This tool handles all standard encodings plus double-encoded values (where %2520 should decode to a space via two passes). The plus-to-space conversion follows the application/x-www-form-urlencoded specification used by HTML form submissions.

Why Use This Tool

Debugging API Requests

When debugging API calls, query parameters often contain deeply nested structures that are difficult to read in URL form. Pasting a complex URL into this tool instantly reveals the structured data being sent — making it easy to spot missing parameters, incorrect nesting, or encoding issues. The bi-directional conversion also lets you build query strings from JSON, which is useful when constructing API requests in tools like curl or Postman.

Everything runs 100% client-side in your browser. URLs containing API keys, tokens, or sensitive parameters are never sent to any server.

FAQ

How does this tool handle nested query parameters?
When bracket nesting is enabled, keys like user[address][city]=NYC are parsed into nested JSON objects: {"user": {"address": {"city": "NYC"}}}. Dot nesting mode handles user.address.city=NYC the same way. Both formats are used by frameworks like Express, Rails, and PHP.
What array formats are supported?
Four array formats: Repeat (color=red&color=blue), Bracket (color[]=red&color[]=blue), Index (color[0]=red&color[1]=blue), and Comma (color=red,blue). The repeat format is the most common in standard URL query strings, while bracket and index formats are used by PHP, Rails, and Express.
Can I convert JSON back to a query string?
Yes. The tool supports bi-directional conversion. Paste a JSON object and it will generate the corresponding query string with proper URI encoding. You can choose which array format to use for the output.
Does this tool handle URL-encoded characters?
Yes. URI decoding is enabled by default, converting %20 to spaces, %26 to ampersands, and other percent-encoded characters. It also handles double-encoding (e.g., %2520) and plus signs as spaces, which is common in form submissions.