DevToys Web Pro iconDevToys Web ProBlog
Rate us:
Try browser extension:

jq Playground

Valid
JSON input
  • Output
  • Loading editor...
    Loading editor...
    FilterDescription
    Pretty-print the whole document
    Iterate over every element of an array
    Read a nested value by path
    Keep only elements matching a condition
    Transform every element of an array
    List the keys of an object
    Convert an object to key/value pairs
    Group elements by a field and count them
    Sort an array by a field
    Count array elements
    Format rows as CSV (enable Raw output)
    Base64-encode a string (enable Raw output)
    List the paths of all numeric values
    Recursively collect all numbers
    Sum values with reduce
    Read all inputs with null input (try several JSON documents)
    Technical details

    How the jq Playground Works

    What the Tool Does

    The jq Playground runs real jq filters against your JSON as you type. jq 1.8 is compiled to WebAssembly and executed in a Web Worker, so results match the command-line tool exactly, including error messages. Paste JSON, write a filter such as .users[] | select(.age > 30) | .name, and the output updates after a short pause. Options map directly to jq flags: raw output (-r), compact (-c), slurp (-s), null input (-n), sorted keys (-S), tab indentation (--tab) and named --arg variables.

    Common Use Cases

    Developers use it to prototype filters before putting them into shell scripts, CI pipelines and Kubernetes or AWS CLI one-liners, to explore large API responses and log lines, to convert JSON to CSV with @csv, to reshape payloads with map, group_by and reduce, and to learn jq through the built-in cheat sheet of clickable examples.

    Inputs, Outputs and Flags

    The input can be a single JSON document or several concatenated documents such as NDJSON; with Slurp they are wrapped into one array and with Null input you read them yourself through input and inputs. Each result is printed on its own line. Raw output prints strings without quotes, which is needed for @csv, @tsv, @base64 and @uri output. Values passed with --arg are available inside the filter as $name and are always strings.

    Pitfalls and Limits

    Input is limited to 5 MB and a run is stopped after 10 seconds so an infinite filter cannot freeze the page. Numbers are processed with jq's double-precision semantics, so integers beyond 2^53 may lose precision. Shell quoting is not needed here: in a terminal wrap the filter in single quotes. This playground does not support jq modules, imports from files, or environment variables.