jq playground
Real jq 1.8 in your browser — input, filter and output side by side, updating as you type, with the command-line flags, --arg and --argjson, over fifty example filters on sample data (a GitHub API response, a Kubernetes pod list, a JSON-lines log, a nested config), the output after every stage of the pipe, and the shell command to copy.
Added
How to use it
This is the real jq — version 1.8.2, the C program compiled to WebAssembly by jq-wasm — not a re-implementation, so filters, error messages and edge cases behave exactly as they do in your terminal. Paste JSON on the left, write a filter on the right, and the output follows as you type.
For formatting, validating, browsing JSON as a tree, JSONPath and diffs, use the JSON workbench. To clean and reshape tables (CSV, Parquet) with SQL, use the data wrangler.
How to use it
Input. Pick a sample — a GitHub repository-search response, kubectl get pods -o json, a log file
of JSON lines, or a nested application config — paste your own, or Open file…. Several values one
after another (JSON lines) are fine: jq runs the filter once per value, as it does on the command
line. Format pretty-prints one document or tidies JSON lines.
Filter. The output updates a quarter of a second after you stop typing (Cmd/Ctrl + Enter runs at
once). Compile errors and runtime errors are shown in red exactly as jq prints them, with the caret
under the problem; output produced before a runtime error is kept, as in the terminal. Messages that
are not errors (debug, stderr) are shown in grey. A filter that runs for more than four seconds
(repeat(1) without a limit) is stopped and jq restarted.
Flags. -r raw strings, -j raw with no newlines, -c compact, -s slurp all inputs into an
array, -n null input (with input / inputs to read), -R raw input lines, -S sorted keys,
--tab. + --arg adds a variable: --arg passes a string, --argjson a JSON value; both appear
as $name and in $ARGS.named.
Examples. Fifty-two filters grouped by task — select and map, group_by and sorting, reduce and
foreach, paths, to_entries / with_entries, @csv @tsv @base64 @sh @uri, string
interpolation and regexes, recursive descent .., limit / first / until, --arg and
--argjson, slurp / -n / -R, and updates, del, def and try. One click loads the example’s
data, flags and filter, with a note on what it shows.
Step through the pipe. Lists every top-level stage of the filter with the output of the program up
to that point, so you can see where a long pipeline goes wrong. Pipes inside brackets, strings,
if … end and def … ; are not split, |= is not a pipe, and a … as $x binding is joined to
the stage that uses it.
Command line. The same run as a shell command — jq -rc --arg ns kube-system '…' pods.json —
quoted for a POSIX shell, optionally with the input inline as a here-document.
History keeps filters that ran cleanly, in this browser only. Share link puts the filter, flags, variables and input in the URL (for a sample, just its name); a large input makes a long link.
Differences from jq in a terminal
-
There is no environment and no file system:
$ENVandenvdescribe the WebAssembly sandbox,input_filenameis/dev/stdin, and--slurpfile,--rawfile,-f,importof modules on disk and--seq/ colour output are not offered. Pass values with--arg/--argjson. -
leaf_pathswas removed in jq 1.8 — usepaths(scalars). Other 1.7 → 1.8 changes apply too (for exampleltrimstron a non-string is now an error).
Browser support
Any current browser with WebAssembly and module workers (Chrome, Edge, Firefox 114+, Safari 15+).
jq runs in a Web Worker, so a slow filter never freezes the page. It does not need cross-origin
isolation or SharedArrayBuffer.
Privacy
jq’s WebAssembly module (about 1 MB, MIT licence) is downloaded once from cdn.jsdelivr.net and cached by your browser. Your JSON and filters are processed on your device and never sent anywhere; the input, filter and history are kept in this browser’s local storage. A share link contains whatever input you share with it.
Feedback is a gift. Something to improve, a feature to add, or a bug? Tell me.
Runs entirely in your browser — network requests go only to the services named on this page.