Query String Parser

Parse and build URL query strings with array parameter support

Enter a query string (with or without leading '?')

Enter parameters as JSON object. Arrays will be formatted as array parameters.

What is Query String Parsing?

Query string parsing extracts parameters from the portion of a URL that comes after the question mark (?). These parameters are key-value pairs separated by ampersands (&), commonly used in web applications, APIs, and search engines to pass data between pages or to servers.

How to Use

  1. Parse Query String: Paste a query string to extract all parameters and their values
  2. Build Query String: Enter parameters as JSON to generate a properly formatted query string
  3. The tool automatically handles URL encoding/decoding and array parameters

Example

Input query string:

search=developer%20tools&category=web&tags[]=javascript&tags[]=typescript&limit=10

Parsed parameters:

  • search: "developer tools"
  • category: "web"
  • tags: ["javascript", "typescript"]
  • limit: "10"

Features

  • Parse query strings into structured key-value pairs
  • Build query strings from JSON parameters
  • Automatic URL encoding and decoding
  • Support for array parameters (key[] syntax)
  • Handle duplicate keys by converting to arrays
  • Preserve empty values
  • Handle special characters correctly
  • 100% client-side processing for privacy

Common Use Cases

  • Debug API request parameters
  • Construct complex search URLs
  • Extract filter parameters from URLs
  • Build pagination query strings
  • Parse analytics tracking parameters
  • Test URL parameter handling in applications
  • Convert between query string and JSON formats

Array Parameters

Array parameters allow multiple values for the same key. This tool supports two common formats:

  • Bracket notation: tags[]=value1&tags[]=value2
  • Indexed notation: tags[0]=value1&tags[1]=value2
  • Duplicate keys: tags=value1&tags=value2 (automatically converted to array)

Frequently Asked Questions

What is a query string parser?

A query string parser breaks down URL query parameters (the part after '?' in a URL) into individual key-value pairs. This tool helps developers extract, analyze, and reconstruct query strings for API requests, URL manipulation, and debugging.

How do I parse a query string?

Simply paste your query string into the input field (with or without the leading '?'). The parser will extract all parameters and display them as key-value pairs. It automatically handles URL decoding, so special characters like spaces and symbols are properly converted.

What are array parameters?

Array parameters allow multiple values for the same key. They're typically formatted as 'key[]=value1&key[]=value2' or 'key[0]=value1&key[1]=value2'. This tool automatically detects and groups these into arrays, making it easy to work with multi-value parameters.

How does the builder handle special characters?

The builder automatically URL-encodes special characters like spaces, @, #, &, and = to ensure the query string is valid. For example, 'hello world' becomes 'hello%20world', and 'user@example.com' becomes 'user%40example.com'.

Can I build a query string from parameters?

Yes! Enter your parameters as JSON object, and the tool will generate a properly formatted and encoded query string. It handles both single values and arrays automatically.

What happens with duplicate keys?

When parsing, duplicate keys are automatically converted to arrays. For example, 'color=red&color=blue&color=green' becomes a single 'color' parameter with an array value ['red', 'blue', 'green'].

Does it handle empty values?

Yes, the parser correctly handles empty values like 'key=' or 'key1=&key2=value'. Empty values are preserved as empty strings, which is important for certain API requirements.

Is my data sent to a server?

No, all query string parsing and building happens entirely in your browser. Your data never leaves your device, ensuring complete privacy for sensitive URLs or API parameters.

Can I use this with API requests?

Absolutely! This tool is perfect for constructing API request URLs, debugging query parameters, and understanding how different services encode their parameters. It's especially useful when working with REST APIs that use complex query strings.