Skip to main content

Query string parser and builder

Parse URL parameters or build a query string from key-value pairs. Processing stays local in your browser.

  • Clipboard
Automate

Embed this widget

Customize the result, check the live preview, then copy the code.

Preview

Embed code type

Code to copy

Responsive and automatically resized by Bethemesh.

Was this tool useful?

How does this tool work?

This tool converts back and forth between a query string (the part of a URL after the ?) and a readable JSON object. In Parse mode it splits the parameters and decodes their values; in Build mode it turns a JSON object into a correctly encoded string, ready to add to a URL.

In Parse mode, if the input contains a ?, only the part after it is read, so you can paste a full URL. Each key=value pair is split on &, then decoded using web form rules, where + stands for a space.

The result is an indented JSON object. A parameter that appears several times becomes an array that keeps all its values in order; the fragment (#section) of a pasted URL is ignored.

In Build mode, the input must be a JSON object. Each property becomes a key=value pair; spaces are written as + and special characters are encoded as %XX, in property order.

Malformed JSON in Build mode produces an error: check the double quotes around keys and values.

How to use this tool

  1. Choose the mode

    Parse to go from a URL to JSON, Build for the reverse.

  2. Paste the input

    A URL or query string in Parse mode, a JSON object in Build mode.

  3. Process

    Click Process to get the result.

  4. Reuse the result

    Copy the JSON or append the generated string after the ? in your URL.

Use cases

Read a tracking URL

Split an ad URL loaded with utm_, gclid or fbclid parameters to see each value.

Prepare an API call

Write the parameters of a GET request as JSON and get the encoded string.

Compare two URLs

Parse two query strings to spot the parameter that differs.

Examples

Parse a search URL

The + becomes a space. The color parameter appears twice, so both values, bleu and vert, are kept in an array.

Input

Mode: Parse
Input: https://example.com/search?q=gourde+inox&color=bleu&color=vert&page=2

Result

Result:
{
  "q": "gourde inox",
  "color": [
    "bleu",
    "vert"
  ],
  "page": "2"
}

Build a query string

Spaces become + signs and the parameters keep the order of the JSON object.

Input

Mode: Build
Input: {"q":"gourde inox","page":"2","tri":"prix croissant"}

Result

Result: q=gourde+inox&page=2&tri=prix+croissant

Tips and best practices

  • Repeated parameters (color=blue&color=green) become an array ["blue","green"]: in Build mode that array gives back both pairs, so the round trip loses nothing.
  • In Build mode every value becomes a string: the number 2 is written 2, and an array ["a","b"] produces one pair per value (key=a&key=b).
  • The fragment (#section) of a URL pasted in Parse mode is never sent to the server, so it is removed before parsing.
  • To encode a single value rather than a whole string, use the URL encoder.

Sources and references

Frequently asked questions

Why is + replaced by a space?

Query strings follow the application/x-www-form-urlencoded format, where + represents a space. A literal + must be written %2B.

What happens to duplicate parameters?

They are grouped in an array, in order of appearance: color=blue&color=green gives "color": ["blue","green"]. Multiple filters on an e-commerce site are therefore preserved.

Can I paste a full URL?

Yes, in Parse mode. Everything before the first ? is ignored and only the query string is split.

What format does Build mode expect?

A flat JSON object, for example {"q":"bottle","page":"2"}. A nested object is not flattened: it becomes the unusable text [object Object].

Is my data sent to a server?

No. Processing runs in your browser.

Related tools

Tools similar or complementary to this one.

Similar tools

Validate, normalize and inspect web addresses locally.

Web & SEOUse this tool

Encode or decode a URL, its parameters, and any special characters it contains.

Web & SEOUse this tool

Turn a title or phrase into a clean slug that is ready to use in a URL.

Web & SEOUse this tool
TutorialBest practicesBeginner

Optimize images for the Web without losing quality

Resize, compress and choose between WebP, AVIF and other formats with a practical workflow that reduces file size without unnecessary visual loss.

30 August 20264 min