jq Playground & JSON Stream Processor

Run jq 1.8.2 filters locally with JSON streams, raw input, slurp, arguments and native exit codes. Inspect and export stdout, stderr and execution metadata.

Process JSON values and real jq filters

The Example reads two JSON records, filters order lines with a JSON argument and adds a string argument. It produces two output values: A with total 40 and C with total 21, each carrying customer 林. The page runs the actual jq 1.8.2 WebAssembly engine. Mapping, select, grouping, reduce, functions, updates, regexes and jq generators use that engine; the filter is not translated into JSONPath, JMESPath or JavaScript.

Input streams, raw lines and null input

JSON mode reads jq’s input value stream, so several JSON values are processed in order. Raw mode (-R) supplies text lines; Slurp (-s) collects JSON inputs into an array or combines raw input into one string. Null input (-n) runs the filter initially with null and skips automatic input reads; explicit input and inputs can still consume the supplied input. The path/value parser settings use --stream or --stream-errors and apply to JSON/null modes. They are hidden and inactive for raw input. Input is a bounded text buffer, not an unlimited streaming upload.

Pass arguments without shell quoting

Enable Arguments to provide JSON objects. String arguments emulate --arg: {"name":"林"} makes $name a string. JSON arguments emulate --argjson and retain the original JSON numeric tokens, including large integers. Values such as arrays, objects and null remain JSON values. Names must be unique across both maps; nonidentifier names are available through $ARGS.named. Filters and argument values are passed as separate argv entries with an end-of-options separator; no shell command is executed.

Multiple results, empty strings and output formats

jq emits a sequence of output values. Multiple values are not automatically wrapped in an array; use a filter such as [.orders[]] when you want one array document. Pretty output can span lines; Compact JSON Lines writes one JSON value per line. Raw output removes quotes only from strings and still prints nonstrings as JSON. Leading/trailing spaces, final line feeds and NUL characters in jq’s UTF-8 output are retained. An empty raw string writes a newline, while empty produces no output. With this jq build, combining ASCII output (-a) with raw output (-r) still quotes and escapes the string; turn ASCII output off to retain raw text bytes.

Exit codes and standard error

The output selector provides stdout, stderr and a JSON report. A compile error or stderr-only result selects stderr automatically. Debug messages may appear on stderr with exit code 0. With -e, false/null and no-result states can have nonzero codes; halt_error can also set a code. The page always reports jq’s actual code instead of treating every stderr message as failure or every nonzero code as an empty result. If execution exits nonzero with stderr after producing stdout, that output is marked as potentially partial and its filename includes .partial.

Numbers follow the bundled jq build

Input and stdout are not parsed and reserialized through JavaScript Number. This build reports have_decnum=true and can preserve the decimal text of unchanged literals such as 9007199254740993123456789012345. jq arithmetic can convert values to binary64 and lose precision; comparisons, exponent limits and formatting follow the bundled jq version. The input parser also follows jq’s duplicate-key behavior. This is a jq tool, not an arbitrary-precision decimal calculator or a strict duplicate-key JSON validator.

Local runtime and explicit limits

Queries run in a disposable browser Worker. Only same-site runtime assets are fetched; input is not uploaded, shared automatically or stored in localStorage. Input is capped at 1 MiB, the filter at 16 KiB, each argument map at 64 KiB and 100 names. Argument structures allow 64 levels and 20,000 values. stdout is capped at 2 MiB and stderr at 64 KiB before sink growth; a persistent overflow marker prevents an I/O error from turning a clipped buffer into an exported result. Loading has a 15-second deadline and execution a separate 5-second deadline. Cancel and edits discard in-flight work.

WASM and filesystem boundaries

The supplied WASM has a 256 MiB linear-memory maximum and finite native stack/recursion limits; this is not a total browser-memory quota. Very deep structures can stop the runtime, after which a fresh run is available. The tool does not mount the host filesystem or fetch jq modules over HTTP. Built-in input reads use /dev/stdin; arbitrary module/library files and CLI file-loading switches are not provided by this interface. A jq filter can still use its language-level functions and the supplied input.

Import and export complete text

UTF-8 files retain original CRLF and BOM data for execution until Input is edited; the textarea may normalize line endings for display. The output preview is limited to 200,000 characters, while Copy and Download use the complete selected file. Compact output downloads as .jsonl, raw output as .txt and pretty output as .json containing jq’s JSON text stream. Choose stderr or the report to export those files. Only UTF-8 text output is supported; jq’s own handling of malformed binary data remains version-dependent.

Related resources

FAQ

Why are there several JSON results instead of one array?

jq filters are generators. Use an array constructor around the desired filter when you want to collect the results into one array.

Does a nonzero code always mean that no output exists?

No. A filter can emit values and then fail; -e also reports truthiness through the exit code. Check stdout, stderr and the report together.

Does the page execute shell commands or upload my input?

No. It passes a jq filter and supported options to a local WASM runtime, without a shell, automatic sharing or input uploads.

Other Languages

jq Playground & JSON Stream Processor — Base64.sh

jq Playground & JSON Stream Processor

Run jq 1.8.2 filters locally with JSON streams, raw input, slurp, arguments and native exit codes. Inspect and export stdout, stderr and execution metadata.

Share:

References

How we make sure

We check this tool with the automated test suites linked below. Example checks are shown in their original language.

Verification method
Check actual jq arguments, numeric tokens, output modes, errors and resource limits.
Comparison reference
Fixed queries and expected JSON/text; invoking the underlying jq-wasm is not a second independent implementation.
Verification scope
These samples and boundaries do not prove correctness for every input.
Test source and cases (select a file to read it)
  • jq-tools.test.js
    • jq invalid modes, byte limits and NUL filter arguments are rejected before execution
    • jq argument maps validate types/names and preserve arbitrary JSON numeric lexemes

These checks cover the listed examples and boundaries, not every possible input. Round trips and checks using the same library are not independent verification.