jq-lite Playground
Evaluate a jq-style path filter against pasted JSON.
Overview
Paste JSON and a jq-style filter and the playground evaluates the filter in-browser, showing the result. Supports the core jq subset: identity (.), field access (.foo.bar), array index (.items[0]), slicing, pipe (|), map, select, length, and the typical operators you reach for daily.
It's for developers wrangling JSON output - API responses, CloudWatch logs, kubectl JSON, configuration files. Reach for it when sketching a filter before pasting into a Bash pipeline, learning jq syntax, or quickly extracting a value from a payload without installing the CLI.
How it works
The playground implements a jq-lite filter language - a strict subset of jq's grammar covering the operators most commonly used in pipelines. The original jq is defined by the project documentation at jqlang/jq; this in-browser version mirrors its semantics for the supported operations.
Filters are parsed into a small AST and walked against the JSON value. Multiple results are streamed as a list (matching jq's "each output value on its own line" behaviour) so a .items[] that yields multiple elements returns them all.
Examples
- Pluck a nested field:
Filter: .user.name Input: {"user":{"name":"Alex","id":1}} Output: "Alex" - Map array elements:
Filter: .items | map(.price) Input: {"items":[{"price":10},{"price":20}]} Output: [10, 20] - Filter with select:
Filter: .users[] | select(.age >= 18) | .name - Array slicing:
Filter: .[0:3] Input: [1,2,3,4,5] Output: [1,2,3]
FAQ
Does it support the full jq grammar?
It's a subset. Functions like walk, recurse, regex, and user-defined functions may not be available. Filters that work in jq-CLI but fail here typically use features outside the supported set.
Why are some outputs on separate lines?
In jq, .items[] yields each element as a separate output - not a single array. The playground preserves this so what you sketch matches what the real CLI does.
Is it safe for sensitive JSON?
Everything runs in the browser. Inputs aren't sent to a server. That said, copying secrets into any web tool is best avoided.
How do I quote a key with special characters?
Use bracket access with a string: .["my-key"] instead of .my-key. The dotted form requires identifier-like names.