JQ Playground

Run jq filters on JSON in the browser.

The jq Playground runs real jq filters against JSON you paste in. The result updates as you type, and four checkboxes mirror the common command-line flags. It is a convenient place to build and test a filter before using it in a shell script.

What is jq?

jq is a command-line tool for slicing, filtering and transforming JSON, often described as sed for JSON. A jq program is a filter: it takes JSON in and produces zero or more JSON values out. The simplest filter is a single dot, which returns the input unchanged. You can pick fields with .name, iterate arrays with .[], select items with select(condition), build new objects with {name, age}, and chain steps with the pipe character. Functions such as map, add, length, keys, sort_by and group_by cover common needs. This tool runs the actual jq program compiled to WebAssembly, so filter syntax and error messages match the command line. Each output value is printed on its own line, pretty-printed by default.

How to use JQ Playground

  1. Paste JSON Put your JSON in the JSON input box. A small sample with a users array is pre-filled. On first use wait for the Loading jq spinner to finish.
  2. Type a filter Enter it in jq filter. The default is .users[] | select(.age > 40) | .name.
  3. Set options Tick Compact output (-c), Raw strings (-r), Sort keys (-S) or Slurp inputs (-s) as needed.
  4. Read the result The Output box shows the result, or an error message appears below it.
  5. Take it with you Copy or download the output, and reuse the filter in your terminal with the same flags.

Frequently asked questions

Is my JSON sent to a server?

No. jq runs in your page as WebAssembly, and the JSON and filter stay in the browser.

Which jq options are supported?

Four: -c compact output, -r raw strings, -S sort keys and -s slurp. Other command-line flags such as --arg are not available in this tool.

Why does it print several lines?

jq emits one output per value the filter produces. A filter like .users[].name produces one result per user, each on its own line.

Why is the output not valid JSON?

Multiple results are printed one after another, and with Raw strings (-r) strings lose their quotes. Wrap results in an array, for example [.users[].name], to get a single JSON document.

What is the size limit?

Input up to 2 MB. Output past 2,000,000 characters is truncated and a warning is shown.

Does it work for JSON Lines?

jq reads a stream of JSON values, so lines of separate JSON values are processed one by one. Tick Slurp inputs (-s) to collect them into one array.