jq Playground
Runs jq 1.7 filters against pasted JSON in the browser with a cheatsheet, and hands you the matching command line.
Runs jq filters against a document in the browser — a real interpreter for the jq 1.7 grammar rather than a few string operations, so pipes, `reduce`, `def`, destructuring and the update operators all behave as they do on the command line. The equivalent shell command is printed under the filter.
Filter
jq '.orders[] | select(.status == "shipped") | {id, customer}' data.json
Input JSON
Drop a .json file
Read in this tab only. Nothing is uploaded.
1 output
Outputs
1
Time
3 ms
Types
object
An interpreter for jq 1.7 grammar, written here. It supports paths (.a[0].b, .., ?), |·,·//, arithmetic, comparison, and/or/not, string interpolation, if, try, reduce, foreach, as (destructuring included), def, updates like |=·+=, formats such as @base64·@csv, and the 180 builtins below. The tests are the jq manual’s own examples.
Not supported: input·inputs (there is only one document), $ENV·env (empty), label·break, --stream, nested arrays in @sh, formats other than ISO 8601 in strptime, getpath stream mode, and modules (import). Regular expressions run on the browser’s engine rather than jq’s Oniguruma, so \p{L} and named groups work, and there may be subtle differences around lookbehind.
If all you want is one path, the JSONPath tester may be simpler.
How to use it
Paste the document
One JSON value, or several in a row — the tool reads them as a jq input stream, and the count is shown in the panel title.
Write the filter, or take one from the row of examples
The buttons cover the shapes that come up: select, map, group_by, string interpolation, reduce, and the update operators. Hovering one says what it does.
Set the flags you would use on the command line
`-c` for one line per output, `-S` to sort keys, `-r` for strings without quotes, `-s` to slurp several inputs into one array. The command line at the bottom updates with them.
Copy the command, not just the output
The generated `jq …` line is properly quoted for a POSIX shell, so it can go straight into a script or a pipeline.
Common questions
Is this really jq?
It is an independent interpreter for jq’s grammar, tested against the examples in jq’s own manual. That covers the language and the common builtins; it is not a compile of jq itself, so anything depending on jq’s C internals will differ.
Why does `input` not work?
Because there is one document here, not a stream a filter can pull more from. `input`, `inputs`, `$ENV`, `env`, `label`/`break`, `--stream` and modules are all listed as unsupported on the page rather than failing mysteriously.
My regular expression behaves differently from jq’s.
jq uses Oniguruma; this uses the browser’s engine. In practice `\p{L}` and named groups work in both, and the differences show up around lookbehind and a few character-class escapes. If a pattern matters, test it on the machine that will run it.
It stopped at 5,000 outputs.
A deliberate limit, along with a step limit. `..` over a large document produces enormous output, and a filter with a runaway recursion would otherwise hang the tab. Narrow the filter, or run it on the command line where you can pipe to `head`.
Feed it from
JSON Lines Converter
Converts between NDJSON and a JSON array, and reports the number of any line that will not parse instead of stopping.
JSONPath Tester
Runs a JSONPath expression against a document and highlights the matched nodes as you type.
JSON Formatter & Validator
Pretty-prints, minifies and validates JSON, pointing at the exact line and column of a syntax error.
YAML Formatter & Validator
Re-indents YAML consistently, validates it, and flags the tab and anchor mistakes that break parsers.
Next
These accept what this tool produces, so the result can go straight in.
JSON ⇄ CSV
Flattens nested JSON into columns or rebuilds objects from a table, with a dot-path column naming rule.
JSON Formatter & Validator
Pretty-prints, minifies and validates JSON, pointing at the exact line and column of a syntax error.
JSONPath Tester
Runs a JSONPath expression against a document and highlights the matched nodes as you type.
JSON Lines Converter
Converts between NDJSON and a JSON array, and reports the number of any line that will not parse instead of stopping.
Base64 Encoder & Decoder
Encodes and decodes Base64 and Base64URL for text or files, handling UTF-8 correctly.
curl to Code
Converts a curl command into fetch, axios, Python requests, Go, PHP or PowerShell.