Advertisement
Guide
About the jq Playground
jq is the command-line tool for slicing, filtering and reshaping JSON: pull one field out of an API response, turn an array of objects into CSV, or rewrite a config file. Its language is small but dense, so it is easiest to learn by trying filters against real data and seeing the result straight away.
This playground runs jq itself, not a JavaScript imitation, so a filter that works here works the same way in your terminal, scripts and CI. Your JSON stays in your browser.
The parts of a jq filter
.is the current value;.nameand.[0]read a key or an index.|passes each output of the left side into the right side, like a shell pipe..[]streams every element; wrap a stream in[...]to collect it back into an array.select(cond)keeps values where the condition is true;map(f)applies f to each element.{name, total: .price * .qty}builds a new object.a // bgives b when a is null or false; a trailing?hides errors.
Variables: --arg or --argjson?
Write name=value for --arg: $name is always a string, so limit=10 compares as the text "10". Write name:=value for --argjson when the value is a number, boolean, array or object. Every variable is also in $ARGS.named.
How to use it
- 1Paste JSON into Input, or open or drop a file. Several values or JSON Lines work too.
- 2Type a filter, or pick one of the examples to start from.
- 3Choose flags such as raw output (-r) or slurp (-s); add variables if the filter uses $names.
- 4Copy or download the output, or copy the shell command to run it on your own files.
Frequently asked questions
Is this the real jq?
Yes. It is jq 1.8.2 compiled from its C source to WebAssembly (the jq-wasm package), so it supports the whole language, including regex functions and arbitrary-precision number literals, and gives jq’s own error messages.
Is my JSON uploaded?
No. jq runs in a worker inside your browser tab. The input, filter and variables are kept in this browser’s storage so they are there when you come back; Reset removes them.
Why does my filter stop after 5 seconds?
Filters such as repeat, recurse with no stopping point or a huge range run forever, and would freeze the page. The playground stops the run after 5 seconds; the same filter would hang in a terminal too.
How do I work with JSON Lines (one object per line)?
Paste the lines as they are: jq reads each line as a separate input and runs the filter on each. Turn on slurp (-s) to get them as one array instead, for sorting, grouping or counting.
Why does my filter work here but not in PowerShell?
PowerShell changes quotes inside arguments it passes to native programs, so the filter jq receives can differ. Save the filter to a file and run jq -f filter.jq input.json, or use bash, WSL or Git Bash.
What does input_filename or $ENV show?
There is no file or real environment in the browser, so input_filename is the standard input and $ENV holds only WebAssembly defaults. Use --arg variables for values you would read from the environment.

