jq

jq Playground

Try:
Input JSON
Output
jq

Enter a jq expression and press Run

or press Ctrl+Enter to run without clicking

. Return input
.keyAccess field
.[]Iterate
map(.f)Transform all
select(.x > 0)Filter
.a | .bPipe
Enter a jq expression and press Run or Ctrl+Enterauto-run onjq · browser only · no data sent

What 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

Identity.

Return the input unchanged

Field access.name

Get the value of a key

Array iteration.[]

Iterate over all items

Index access.[0]

Get first array element

Pipe.users[] | .name

Chain two filters

Select / filter.[] | select(.age > 18)

Keep only matching items

Map / transform.users | map(.name)

Apply filter to every element

Object construction{name: .name, id: .id}

Build a new object

Sort by fieldsort_by(.created_at) | reverse

Sort and reverse an array

Unique values[.[].status] | unique

Distinct status values

Count.[] | select(.active) | length

Count active items

String interpolation"\(.name) <\(.email)>"

Build a string from fields

Split a string.email | split("@")

Turn a string into an array

Join an array.tags | join(", ")

Turn an array into a string

Regex matchselect(.name | test("^A"))

Filter by a regular expression

Supported Features

Dot field access
Array index / slice
Object iteration
Pipe operator |
Comma fork ,
Alternative //
if / then / else
try / catch
reduce
foreach
Variable binding as
def (user functions)
map / map_values
select / empty
sort / sort_by
group_by / unique
to_entries / from_entries
keys / values
has / in / contains
flatten / add
range / limit
string functions
math functions
path expressions

Where jq Earns Its Keep

  • Debugging API responsesPipe curl output straight into jq to pull out just the fields you care about instead of scrolling raw JSON.
  • Shell scripts and CI pipelinesjq is the standard way to parse JSON in Bash — test the exact filter here before dropping it into a script.
  • Reshaping data for another toolUse map and object construction to transform an API response into the shape a downstream tool or import expects.
  • Ad-hoc log and data analysisFilter, group_by and count records in a JSON export without writing a throwaway Python or Node script.
  • Learning jq itselfTry the sample queries and see results update live — a faster feedback loop than testing in a terminal.

Frequently Asked Questions

It implements the core jq language developers use daily: pipes, filters, select/map/reduce, object construction, string and math functions, and path expressions. Some highly specialized or rarely-used builtins may not be covered — if a query fails unexpectedly, check it against the jq manual.

No — that's the point. This runs a jq interpreter entirely in your browser, so you can test a filter before using it in a terminal, CI pipeline, or script that does have jq installed.

Yes, that's exactly what this playground is for — write and verify jq expressions here, then paste the working filter into your shell script or CI config with confidence.

Each output is shown as its own numbered result card, with its own type badge and Copy button — useful for filters like .[] that emit one value per array element.

No. The jq interpreter runs entirely client-side in your browser — your data is never sent to a server.

Pipe the command's JSON output straight into jq: curl ... | jq '.data[].id' or kubectl get pods -o json | jq '.items[].metadata.name'. Test the exact filter here on a saved copy of the output first, then reuse it in the pipeline with confidence.

Use string interpolation inside double quotes: "\(.firstName) \(.lastName)" inserts the value of each expression directly into the string, which is the jq equivalent of a template literal.

Related Tools