No Login Data Private Local Save

URL Query String to JSON – Online Parse & Format

20
0
0
0

URL Query String to JSON

Parse, format, and convert URL query strings into clean JSON — with nested object & array support.

Instant Parse Nested Objects Array Support Client-Side Only
Query String / URL Simple Nested Arrays Full URL
JSON Output âś“ Copied!

Frequently Asked Questions

A URL query string is the portion of a URL that follows the ? character. It contains key-value pairs separated by & symbols, used to pass parameters to web servers. For example, in https://example.com/search?q=hello&page=2, the query string is q=hello&page=2. Query strings are essential for web forms, API requests, tracking parameters, and dynamic page content.

Converting a query string to JSON involves parsing the key-value pairs and organizing them into a structured JavaScript object. Our tool does this automatically: simply paste your query string (or full URL) into the input box, and the parsed JSON appears instantly. You can toggle Nested Mode to handle advanced patterns like user[name]=John becoming {"user":{"name":"John"}}, and array parameters like tags[]=js&tags[]=css becoming {"tags":["js","css"]}.

Nested query parameters use square bracket notation to represent hierarchical data structures. For example, address[city]=London&address[zip]=SW1A represents a nested object with an address key containing city and zip sub-keys. This convention is commonly used in PHP applications (where it maps to $_GET superglobal arrays), Ruby on Rails, and various REST APIs. Our Nested Mode automatically detects and expands these into proper nested JSON objects.

Arrays in query strings are typically represented using empty square brackets [] or numeric indices [0], [1]. For instance, colors[]=red&colors[]=blue is parsed as {"colors":["red","blue"]}. Similarly, items[0]=apple&items[1]=banana produces {"items":["apple","banana"]}. Duplicate keys without bracket notation (e.g., tag=js&tag=css) are also intelligently grouped into arrays when detected.

Pretty JSON is formatted with line breaks and indentation (2 spaces), making it human-readable and easy to inspect. It's ideal for debugging, documentation, and manual review. Compact JSON removes all unnecessary whitespace, producing a single-line output that's smaller in file size — perfect for API payloads, data transmission, or when you need to minimize bandwidth. Use the toggle buttons above to switch between the two formats instantly.

Yes! Click the Reverse button below the JSON output to convert your JSON back into a URL-encoded query string. This handles nested objects (converting them to bracket notation like a[b]=c) and arrays (generating [] suffix notation). The reverse conversion is particularly useful when you need to construct API query parameters from a JSON configuration object.

Absolutely. All parsing and conversion happens entirely client-side within your browser. Your query strings and JSON data are never sent to any server, logged, or stored. This makes the tool safe for sensitive data like API keys, authentication tokens, or personal information that may appear in URLs. You can verify this by disconnecting your internet — the tool continues to function perfectly offline.

Common use cases include: debugging web applications by inspecting URL parameters in a structured format; API development when converting query parameters to request body JSON; data extraction from tracking URLs or UTM parameters; testing endpoint parameter combinations; and learning how web protocols encode data. Developers often need to transform URL-encoded data into JSON for further processing in JavaScript, Python, or other languages.