Data Formats

jq Playground

Run real jq filters against JSON, using jq itself compiled to WebAssembly.

  • History kept on this deviceRecent results are kept in this browser's local storage until you clear them.
  • Runs in your browserProcessing happens in this page. No application server receives your input.
Stopping a run discards the engine, and the next run loads it again. input and inputs read only later documents in the input box. $ENV and env hold fixed placeholders, apart from LANG, which follows your browser's language. include and import fail, because there is no filesystem.

JSON input

Engine not loaded Downloads the jq engine (2.7 MB) the first time you press Load engine.

Output

What this tool does

Run applies a jq filter to JSON text with the real jq engine, compiled to WebAssembly, and shows what jq writes. For example, .users | map(select(.active)) | length over {"users":[{"name":"a","active":true},{"name":"b","active":false},{"name":"c","active":true}]} counts the active users, and the output is 2.

Copy copies the output. Everything runs in your browser, and nothing in the input or the filter is sent anywhere.

What it does not do

There are no option fields such as -r, -c, -s or -n, no run as you type, no download, no saved filter library, and no partial output from a run that failed. Run runs when you press it, or press Enter in the filter field.

The engine

  • The engine is 2.7 MB, and it downloads on first use, when you press Load engine. Nothing is fetched before that.
  • Stopping a run discards the engine, and the next run loads it again, which needs the network until the cache and hosting work of steps 149 and 151.
  • There is no automatic time limit, because a tool that kills a filter at a fixed time is worse than one that lets you decide. A run that writes nothing and never ends stops only by Cancel, which costs the engine and gives the tab back.
  • A very deep program may stop the engine, and so may del and delpaths over a value nested from about 19 levels. The page then shows that the engine was stopped.

The dialect

  • input and inputs read only later documents in the input box.
  • $ENV and env hold fixed placeholders, apart from LANG, which follows the browser's language.
  • include and import fail, because there is no filesystem.
  • input_filename reads inputString, as jq's messages do.

Reading results

  • A run that ends in an error shows no output from before the error, unlike the command line.
  • debug and stderr text is not shown.
  • A repeated key keeps its last value, and a warning appears only for a single-document input.
  • Numbers beyond 2^53 change under arithmetic.
  • Input and output nesting stop at 32 levels, because this build cannot print deeper values correctly. A program that turns a deeper value into a string, through tojson, tostring, @json, another @ format, string interpolation or error, may stop the engine or run until stopped, and a wrong string is not ruled out. This is risk reduction, not a guarantee.
  • now differs per run.

The filter field

A pasted filter's line breaks become spaces. One with a # comment is refused, because a comment runs to the end of the line and the field is one line. Text over the filter's limit is not pasted.

Limits

BoundValueAt the bound
Input16.0 MBRefused before the engine is called
Filter2.0 KBRefused before the engine is called
Output16.0 MBThe run is ended, with no partial output
Shown output262,144 charactersThe box shows the first part, and says so
Message64.0 KBCut on a whole character, and says so
Nesting32 levelsRefused for input, ended for output

The box shows the first part of a long output, and Copy copies all of it while the output is current. An edit or a new press puts the rest out of reach until the filter runs again.

Storage

The page keeps your input, filter and output across a reload when they fit in 131,072 characters together. An input and filter over that are not kept, and a larger output is kept only until you reload, with the input and filter kept if they fit. When storage is unavailable, every run still completes.

Scope: this covers the page itself. Your browser, operating system, clipboard, downloads, extensions, and crash recovery may keep copies, and a compromised site origin would not be protected.