
A query string parser converts the part of a URL after the question mark into structured data. The query string q=json+parser&page=2 becomes the object {"q":"json parser","page":"2"}, with each key and value URL-decoded so a plus sign turns back into a space and %2F turns back into a slash. This tool parses in that direction, and also runs the reverse: it builds a correctly encoded query string from a JSON object of key-value pairs.
Query strings look simple until repeated keys and array syntax appear. The same key can occur more than once, as in tags=react&tags=laravel, and many frameworks encode arrays and nested objects with brackets, such as tags[]=react or filter[color]=red. A parser has to decide whether those become an array, a nested object, or a last-value-wins scalar, and different back ends disagree. This tool exposes those choices so the JSON you get matches the system that produced the URL, and the query string you build matches the system that will read it.
Everything runs in your browser. Parsing, decoding, and encoding are done in JavaScript, so nothing is uploaded, logged, or stored. That is worth having for URLs that carry session tokens, tracking parameters, or signed values in the query, because those never leave your machine, and the tool keeps working offline once the page has loaded.
Query strings have less of a standard than their ubiquity suggests, and repeated keys are where implementations diverge. Given a=1&a=2, some frameworks return an array, some the first value, some the last. Bracket notation such as a[]=1&a[]=2 is a PHP convention that many libraries adopted and no specification defines, so a server that does not know it will read the literal key a[]. Both forms are shown here so you can see what a given string actually contains. Encoding is the other half: a space may be a plus sign or %20 depending on whether the string came from a form submission or from a URL path, and the two are decoded differently. An ampersand inside a value has to be encoded, or it silently becomes a parameter separator.
Parse turns a query string or full URL into JSON. Build turns a JSON object into a query string. Load the sample to see both directions with arrays and encoding.
In parse mode, paste a full URL or a bare query string; the fragment after # is ignored and everything before ? is stripped. In build mode, paste a JSON object of key-value pairs.
Pick how repeated keys are handled, whether bracket keys become nested structures, and how arrays are encoded when building. URL decoding and plus-as-space are on by default.
Read the parameter table and copy the JSON, or copy the generated query string, ready to paste into a URL, a fetch call, or a test.
Parse a query string into JSON and build a query string back from JSON in one tool, so you can round-trip a URL while editing its parameters.
Repeated keys can collapse to an array, keep the first value, or keep the last. Bracket keys like tags[] and filter[color] parse into arrays and nested objects.
Values are URL-decoded on parse and percent-encoded on build, with a plus-as-space option, so reserved characters such as &, =, and spaces survive the round trip.
Paste a whole URL and the parser strips the scheme, host, path, and fragment for you, or paste just the query string. Either way you get the same parameter table.
Turn any title or text into a clean, SEO-friendly URL slug - with accent transliteration, hyphen or underscore separators, stop-word removal, and batch mode.
Break any URL into its parts - scheme, host, port, path, query, and fragment - and read the query string as a clean, decoded key-value table.
Build tagged campaign URLs for Google Analytics 4 with utm_source, utm_medium, utm_campaign, utm_term and utm_content - plus channel prediction, tagging warnings, batch mode and CSV export.
Encode and decode URLs, query strings, and form data with encodeURIComponent, encodeURI, or form-urlencoded modes
0 comments
No comments yet. Be the first to share your thoughts!