Query parameters to JSON

Converting query parameters to JSON splits the part after ? on & and = and percent-decodes each name and value.

Features

  • Full URLs acceptedThe path and fragment are ignored.
  • Repeated keysThey are collected into an array.
  • Runs on your deviceYour data is processed in the browser and is never uploaded.

How to use the Query parameters to JSON

  1. Paste a URL or query string.
  2. Read the decoded values.
  3. Copy the JSON.

Plus signs

Following form encoding rules, + is read as a space. A real plus sign should be sent as %2B.

Parse query parameters in JavaScript

const params = new URL(url).searchParams;
const object = Object.fromEntries(params); // keeps the last value of repeated keys
const tags = params.getAll('tag');

Frequently asked questions

Are values typed?

No. Query values are always text.

Is the URL requested?

No. It is only read as text.

What about a[b]=1 syntax?

The key is kept as written.

Related tools