jq Playground
Enter a jq expression and press Run
or press Ctrl+Enter to run without clicking
. Return input.keyAccess field.[]Iteratemap(.f)Transform allselect(.x > 0)Filter.a | .bPipeWhat is jq?
jq is a lightweight command-line JSON processor. You can think of it as sed for JSON data — slice, filter, map, and transform structured data with a simple, powerful expression language.
This playground runs a complete jq interpreter directly in your browser. No installation, no server round-trips — your JSON data never leaves your device.
Common jq Patterns
.Return the input unchanged
.nameGet the value of a key
.[]Iterate over all items
.[0]Get first array element
.users[] | .nameChain two filters
.[] | select(.age > 18)Keep only matching items
.users | map(.name)Apply filter to every element
{name: .name, id: .id}Build a new object
sort_by(.created_at) | reverseSort and reverse an array
[.[].status] | uniqueDistinct status values
.[] | select(.active) | lengthCount active items
"\(.name) <\(.email)>"Build a string from fields
.email | split("@")Turn a string into an array
.tags | join(", ")Turn an array into a string
select(.name | test("^A"))Filter by a regular expression
Supported Features
Where jq Earns Its Keep
- ▸Debugging API responses — Pipe curl output straight into jq to pull out just the fields you care about instead of scrolling raw JSON.
- ▸Shell scripts and CI pipelines — jq is the standard way to parse JSON in Bash — test the exact filter here before dropping it into a script.
- ▸Reshaping data for another tool — Use map and object construction to transform an API response into the shape a downstream tool or import expects.
- ▸Ad-hoc log and data analysis — Filter, group_by and count records in a JSON export without writing a throwaway Python or Node script.
- ▸Learning jq itself — Try the sample queries and see results update live — a faster feedback loop than testing in a terminal.