Skip to content
100% local

jq filter builder

Turn a JSON document into a working jq filter, previewed against your own data.

Input
Output

jq filter builder

Paste a JSON document and this tool lists every field path it contains, in jq's own dot-and-bracket syntax — .users[].email, .items[0].price, and so on — so you don't have to guess the shape of data you didn't write yourself. Pick one of those paths, or type your own, and the tool builds a working jq filter around it.

The operation option controls what kind of filter gets built. Select returns the path's value or values, one per line, exactly the way plain jq prints a stream. Map wraps the same values into a single JSON array with square brackets. Filter needs a path that ends in [] and a condition like age > 18 or status == "active" — it keeps only the elements that match, using select() under the hood. Aggregate points at a whole array (no trailing []) and reports its count, and — when every element is a number — the sum, minimum and maximum too; add a condition to aggregate only the elements that pass it first.

Raw string output strips the quotes from string results, matching jq's -r flag; compact output collapses the JSON to one line instead of two-space indentation. The jq syntax version option tags the generated filter with a comment for jq 1.5, 1.6 or 1.7 — useful when you're pinning a pipeline to a specific release — without changing what the preview computes, since the subset of jq this tool implements behaves the same across all three. Conditions support ==, !=, >, >=, <, <= and contains, and compare against numbers, strings, booleans, null or quoted text.

Everything runs locally in your browser: the JSON you paste, the filter you build and the result it produces never leave your device. When you're happy with the filter, copy the result, download it as a .txt file, or send the output back into the input to keep refining it.

FAQ

Does this run a real jq binary?
No. It implements a practical subset of jq path syntax and operations in JavaScript, so the same filter you see here may need adjustment for edge cases a full jq install would handle.
Why does Filter need a path ending in []?
Filtering keeps or drops individual elements of an array, so the path has to name an iterated collection — .users[] rather than .users. The tool tells you if it doesn't.
What does the condition field accept?
A field name plus an operator and a value, like age > 18 or status == "active", or just an operator and value (> 10) to compare an array's elements directly. Supported operators are ==, !=, >, >=, <, <= and contains.
Why does Aggregate only show a count for some paths?
Sum, minimum and maximum only make sense for an array of numbers. When the array holds objects — a list of users, say — you still get a count, optionally narrowed by a condition first.
Is my JSON uploaded anywhere?
No. Parsing, path discovery and filtering all happen in your browser — your document is never sent to a server.