jq Playground
Run jq filters over your JSON in-browser — jq 1.8.2 on WebAssembly, stdout and errors verbatim, entirely on this device.
jq runs when you press Run — ⌘/Ctrl + Enter, or Enter in the filter field.
Press ? for shortcuts
Do it offline:$ jq '.' file.json
How to use it
- Paste or drop JSON into the input pane — one value, or several separated by whitespace.
- Type a jq filter; the default, a single dot, returns the input unchanged.
- Toggle the flag chips — compact, raw, slurp, null input, sorted keys — or load a sample recipe.
- Press Run (or ⌘/Ctrl + Enter), then copy, download, or share the state as a link.
Paste JSON, type a jq filter, and press Run. jq 1.8.2 — compiled to WebAssembly — runs the filter on this device, the same program you would run at a terminal. Whatever jq writes to standard output appears verbatim in the output pane, and jq's own compile and runtime errors are shown word for word. Nothing is uploaded.
How it works
jq is a stream processor, not a path selector. A filter maps each input value to a stream of zero, one or many results, one result per line. .[] iterates an array element by element, the empty builtin yields nothing, and a key like .name gives one value.
Each run surfaces what the jq process returns: standard output, standard error and an exit code. Success is exit 0 with empty standard error. The debug and stderr builtins and deprecation notices also exit 0 — warnings, not failures — so they sit in a chip beside the output. A compile error exits 3 and a runtime error exits 5, each printed verbatim.
Since jq 1.7 the parser keeps a large number's literal digits instead of narrowing it to a float, so an id past two-to-the-53rd — where JavaScript's numbers start to round — passes through a filter intact. The playground therefore hands your text to jq, not the browser, so 12345678901234567890 survives.
Examples
{"id":12345678901234567890,"role":"admin"}{
"id": 12345678901234567890,
"role": "admin"
}Identity pretty-prints with two-space indent and keeps key order; the id past two-to-the-53rd survives every digit.
[{"name":"ada","id":1},{"name":"lin","id":2}]"ada"
"lin".[] streams the array and .name reads a field from each — two inputs, two quoted lines (add -r to drop the quotes).
[{"item":"pen","price":5},{"item":"lamp","price":24}][{"item":"lamp","price":24}]select filters, map rebuilds the survivors into one array, and -c prints that array on a single line.
{"gamma":3,"alpha":1,"beta":2}[
"alpha",
"beta",
"gamma"
]keys returns field names as a sorted array — alpha, beta, gamma — not the typed order; keys_unsorted keeps it.
{"a":1}jq: error: syntax error, unexpected end of file at <top-level>, line 1, column 2:
.[
^
jq: 1 compile errorAn unfinished filter never runs; jq's syntax error, caret and all, is shown verbatim and the input is left untouched.
Every example on this page is executed against the same engine that powers the tool, on every build.
Gotchas worth knowing
A filter returns a stream, not one document
One filter may emit nothing, one value, or thousands, each on its own line. Wrap it in square brackets to collect them, or slurp first with -s.
-r prints strings without their quotes
Raw output drops the double quotes from string results, so "ada" prints as ada — handy when piping into a shell or CSV cell. Non-strings pass untouched.
-s slurps every input into one array
Slurp reads the whole input, even a whitespace-separated stream, into one array first: add over 1 2 3 becomes add over [1,2,3] and returns 6.
Runaway filters are stopped automatically
jq has no step limit and a WebAssembly call cannot be interrupted, so a filter that never ends — while(true;.), repeat(.), range(1e12) — is halted by stopping the worker: about two seconds once jq has loaded, longer on the first run, which loads it too.
-C color output is left out on purpose
The color flag wraps results in ANSI escape codes meant for a terminal, which here print as stray litter. Use jq -C in a real terminal for color.
jq is not JSONPath
They share no syntax: JSONPath selects with expressions like $.store.book[0]; the jq path .store.book[0] only starts a program that reshapes, not merely locates.
Common errors
jq: error: syntax error, unexpected IDENT, expecting end of file at <top-level>, line 1, column 4: .a b ^ jq: 1 compile error- Two expressions side by side, like .a b, do not parse — jq is a pipeline, so join stages with a pipe or operator. It names the token it did not expect, carets it, and runs nothing.
jq: error (at /dev/stdin:0): Cannot index array with string ("name")- The filter .name wants a field, but the input is an array; iterate first with .[] for objects. Runtime errors exit 5, and jq streams, so output may already have printed.
Input is larger than the 1 MB limit for this tool. For bigger payloads use the CLI: jq '.' file.json- jq runs on WebAssembly in this tab, so input is capped at 1 MB. Past it the tool refuses whole rather than truncate, and points to the jq binary, which has no cap.
The run took too long and was stopped — try a smaller input or a filter that terminates.- A WebAssembly call cannot be paused, so the only way to stop a non-terminating filter is to end the worker — about two seconds once jq has loaded, longer on the first run. Narrow the filter or input and Run again.
FAQ
Which jq version runs here, and does my JSON get uploaded?
It runs jq 1.8.2, compiled to WebAssembly and executed in this browser tab — no server call, nothing uploaded. A filter that works here behaves the same in the jq binary on your machine.
Why did my filter print several separate lines?
Each line is one output value. A jq filter produces a stream, so .[] over a three-element array emits three values, one per line. Wrap it in square brackets to gather them, or use -s to slurp the input first.
How is this different from a JSONPath tester or a path finder?
A path tester or click-to-copy finder answers one question — which value sits at a path. jq is a transformation language: it filters, reshapes, groups and builds new JSON. Use a path to read a value; use jq to rewrite the document.
Keyboard shortcuts
- ⌘/Ctrl + Enter
- Run the current filter now.
- ⌘/Ctrl + S
- Download the output as a .txt file.
- ⌘/Ctrl + C
- Copy the output when nothing is selected.
- ⌘/Ctrl + Shift + C
- Copy the output even with a selection active.
- t
- Cycle the color theme.
- ? or ⌘/Ctrl + /
- Show the shortcut overlay.
- Esc
- Dismiss the overlay, or cancel a running filter.