Query String Parser & Builder Online

Local processing

Parse query parameters into JSON, build encoded query strings, clean and sort parameters in one pass, or run focused sorting and cleanup operations.

29 chars · 1 line

60 chars · 7 lines

3 parameters2 unique keys1 repeated key

Query parameter guide

How to parse and build query strings

Parse a complete URL or raw query string into readable JSON, build an encoded query string from a JSON object, or clean and sort an existing query in one pass. Focused modes can also sort by key, remove exact duplicate key-value pairs, drop empty values, or strip common analytics and ad tracking parameters. Repeated business parameters and reserved characters use browser-native URLSearchParams behavior, and the data never leaves your browser. This tool is free to use. No account or payment is required.

Last updated

What you can do here

  • Full URL and raw query parsing
  • Repeated parameter arrays
  • JSON object to query string conversion
  • Primitive value validation
  • One-pass clean and sort workflow
  • Duplicate, empty, and tracking parameter cleanup
  • Browser-local processing

How to use

  1. Choose Parse to JSON, Build Query, Clean & Sort, or one of the focused sorting and cleanup modes.
  2. Paste a full URL, raw query string, or JSON object for the selected operation.
  3. Review repeated keys, encoded characters, and validation details in the output.
  4. Copy or download the converted query data.

Parse complete URLs or raw query strings

You can paste an absolute URL, a relative URL containing a question mark, or only the query parameters. When a URL is supplied, the parser reads the text after ? and ignores the fragment after #.

The result is formatted JSON, making API callbacks, tracking links, and browser request parameters easier to inspect.

Repeated parameters and arrays

Repeated keys become JSON arrays instead of overwriting earlier values. In the other direction, arrays of primitive JSON values become repeated query parameters in their original order.

  • name=Ewan becomes a JSON string value.
  • tag=json&tag=tools becomes an array with two values.
  • Spaces follow form-style URLSearchParams behavior and are written as plus signs when building.

Build queries from safe JSON values

Build mode requires a top-level JSON object. Each property may contain a string, number, boolean, null, or an array of those primitive values.

Nested objects, non-finite numbers, and unsafe integers are rejected rather than being flattened or silently rounded.

Sort query parameters without dropping repeats

Sort Query orders parameters by key using URLSearchParams sorting while preserving the original order of values that share the same key. This is useful when comparing requests or preparing a predictable query representation.

Remove exact duplicate parameters safely

Remove Duplicates keeps the first occurrence of each decoded key-value pair and drops later identical copies while preserving the original order. Repeated keys with different values remain intact, so tag=json&tag=tools is not collapsed into a single parameter.

Clean and sort a query in one pass

Clean & Sort combines the common cleanup sequence into one operation: it removes tracking parameters and empty values, drops later exact duplicate key-value pairs, then sorts the remaining parameters by key. Repeated keys with different values stay in their original relative order.

Remove common tracking parameters

Remove Tracking drops common campaign and click identifiers such as utm_* parameters, gclid, fbclid, msclkid, and related platform-specific IDs while preserving the order and values of application parameters. Matching is case-insensitive, but lookalike business keys such as custom_utm_source remain untouched.

Query string parsing example

Repeated tag parameters are preserved as an array, while other values remain strings because query strings do not carry JSON data types.

Query string input

?name=Ewan&tag=json&tag=tools&active=true

JSON output

{
  "name": "Ewan",
  "tag": [
    "json",
    "tools"
  ],
  "active": "true"
}

Common questions

Frequently asked questions

Can I paste a complete URL?

Yes. The parser extracts the query portion from an absolute URL or a relative URL containing a question mark and ignores the fragment.

Why does a plus sign become a space?

URLSearchParams follows application/x-www-form-urlencoded behavior, where plus signs represent spaces while percent-encoded %2B represents a literal plus sign.

Can build mode flatten nested JSON objects?

No. Values must be primitives or arrays of primitives so the generated query string has predictable repeated-key semantics.

What does Clean & Sort change?

It removes common tracking parameters and empty values, keeps the first copy of each exact key-value pair, preserves distinct repeated values, and sorts the remaining parameters by key.

Which tracking parameters does Remove Tracking delete?

It removes utm_* campaign parameters plus common click identifiers including gclid, dclid, fbclid, msclkid, gbraid, wbraid, twclid, yclid, igshid, mc_cid, and mc_eid. Other parameter names are preserved.

Are query parameters uploaded?

No. Parsing, JSON validation, and query construction run locally in your browser.

Looking for broader references? Browse all developer guides.

Debugging a specific Query String issue? Browse Query String troubleshooting.