Skip to main content
NeatUtility

Query String Parser & Builder

Web & API100% Client-Side
Ready
URL
0 lines0 chars
0 B / 1.91 MB
About this tool, examples & FAQ

Parse URL query strings into structured JSON and serialize JSON objects back into encoded query strings, entirely in your browser. Repeated keys become arrays, bracketed keys nest into objects, and array serialization follows the selected repeat, brackets, indices, or comma format. The tool only emits a query string, never a complete URL.

Key facts

Verified capabilities and limits of this utility
Accepted inputQuery-string text for parsing; a JSON object for building (top-level arrays produce degenerate empty-key pairs and should be wrapped in an object).
Array serializationRepeat keys, brackets, indices, or comma-separated, with optional key sorting, null skipping, query prefix, and type parsing
Editing modelRaw text and JSON editor in a transform workspace; structured input is typed or pasted, not assembled row by row
Max input size2 MB
Execution deadline2 s
Processing locationBrowser-only: pasted input is not uploaded

How to use

  1. Select your operation: 'Query String → JSON' or 'JSON → Query String'.
  2. Paste a query string (such as ?foo=bar&tags=a&tags=b) or a JSON object into the input editor.
  3. Choose the array encoding format (repeat, brackets, indices, comma) plus sorting and prefix preferences.
  4. Click 'Run' to transform your data.
  5. Use 'Copy', 'Download', or pipe results into another utility using 'Send To'.

Examples

Parse repeated keys and encoded spaces

Input

tag=one&tag=two&q=hello+world

Example output

{
  "tag": [
    "one",
    "two"
  ],
  "q": "hello world"
}

Build a query string with repeated keys

Input

{"tag":["one","two"],"q":"hello world"}

Example output

tag=one&tag=two&q=hello%20world

Edge cases

Conflicting nested shapes are dropped with a warning

When one key is used both as a scalar and as a nested object, the conflicting value is dropped and reported with a shape-conflict warning instead of silently overwriting kept data.

Prototype path segments are rejected

Key path segments such as __proto__, constructor, and prototype are refused with an invalid-input error rather than assigned into the result object.

Leading zeros stay strings under type parsing

Optional number parsing converts plain numeric strings but leaves leading-zero values such as 007 as strings, so codes and identifiers are not mangled.

Output is only a query string

Building emits the serialized parameters alone. The tool does not attach them to a base address or generate a complete URL.

How it works

  1. For parsing, isolates the query after ? (dropping any fragment), splits on & and =, and decodes plus-as-space and percent escapes.
  2. Aggregates duplicate keys into arrays and expands bracketed key paths into nested objects and arrays.
  3. For building, walks the parsed JSON value and encodes keys and values with the selected array format and sorting rules.
  4. Executes inside a Web Worker bounded by the tool deadline.

Frequently asked questions

How are repeated keys handled?

Repeated keys such as tag=one&tag=two parse into an array under one key, preserving order. Building with the repeat format serializes an array back into repeated key-value pairs.

How are special characters in values escaped?

Parsing decodes percent escapes and plus-as-space; building percent-encodes keys and values, so hello world becomes hello%20world. Reserved separators such as & and = are always encoded in values.

Is parameter order preserved?

Yes, by default entries keep their input order through parsing and building. Enable key sorting only when you explicitly want alphabetical output.

Which array formats are supported?

Repeat (a=1&a=2), brackets (a[]=1&a[]=2), indices (a[0]=1&a[1]=2), and comma-separated (a=1,2). Choose the format your server or API expects before building.

Can I paste a whole URL, and does building return one?

Parsing accepts a full URL and isolates the part after ? for you. Building only returns the query string itself — paste it onto your own base address; no complete URL is generated.

References

  • WHATWG URL Standard — Query-string, percent-encoding, and Plus-as-space conventions modeled by the handwritten parser/builder