jq Playground
Paste JSON, run jq expressions instantly; the everyday syntax is covered and unsupported parts say so.
jq is the de-facto query language for JSON on the command line, and the hard part is never the grammar — it is "what does this expression actually output": does iteration flatten the object, can select see outer fields. This page puts jq in your browser: JSON on the left, expression on top, results rendered as JSON instantly, recomputed on every keystroke.
The evaluator is a hand-written jq subset covering the everyday 90%: paths and iteration (., .foo, .[], ..), select and map, pipes and comma, object construction, comparisons and arithmetic, and two dozen builtins. Keeping it small buys honesty: syntax outside the subset (variables, def, reduce) reports "not supported" instead of producing plausible-looking wrong answers.
Everything is a stream
jq's mental model: a filter takes each input and emits zero or more outputs. .users[] fans an array into three outputs, select filters some to zero, [..] gathers the stream back into an array. The page materializes that stream and labels its count — once "stream" clicks, most jq expressions read themselves.
Object construction is the reshaping tool
{count: .meta.total, names: [.users[].name]} reassembles scattered fields into the shape the frontend wants — the standard move for trimming backend payloads. The shorthand {foo} means {foo: .foo}, halving the typing when cherry-picking fields.
Frequently asked questions
- Which syntax is supported?
- The cheat sheet at the bottom lists it all: paths, iteration, pipes, comma, // defaults, and/or/not, comparisons, arithmetic, array/object construction, and builtins like select/map/keys/has/add/sort/unique/join/split/to_entries. Variables $x, def, reduce, if and string interpolation are outside the subset and reported as such.
- Do results match the real jq?
- Within the subset, yes — the evaluation model is the same stream semantics. Numeric precision and ordering edge cases follow shared JS/jq behavior; for exotic inputs trust the CLI.
- Is my JSON uploaded?
- No. The evaluator runs in the browser with zero network calls — API responses and logs are safe to paste.