jq Playground Online — Test, Filter & Debug jq Expressions in Browser

jq Playground & Filter Builder

Interactive jq expression tester, filter builder, and JSON transformer powered by WebAssembly.

Free interactive online jq playground and JSON query builder powered by official jq 1.8.2 compiled to WebAssembly. Test, debug, and preview jq filters against your JSON data in real time with sub-millisecond latency and total privacy. Explore dozens of ready-to-use recipes for property extraction, conditional filtering, object reshaping, array aggregation, grouping, and unique values. Toggle CLI flags like -s (slurp), -r (raw output), -S (sort keys), -c (compact), and --tab with one click, and copy ready-to-run terminal commands. All execution runs locally in your browser inside an isolated WebWorker without sending data over the network.

Keywords: jq playground, jq online, jq tester, test jq expression online, jq filter online, jq cheatsheet tester, webassembly jq, jq query builder, jq json transformer, online jq editor, jq tutorial playground, jq slurp jsonl, jq raw output

Tags: jq, json, query, filter, transform, wasm, cli, playground, jsonl

Browse all 12 Text & Data tools →

jq Playground & Filter Builder is also known as: Online jq Tester, jq Filter Online, Web jq Playground, jq JSON Processor Online, jq Cheatsheet Playground, jq Query Builder, jq WebAssembly Sandbox, jq Online Editor.

How to jq Playground & Filter Builder Online

  1. Paste your JSON payload into the left editor panel, or upload a .json / .jsonl file.

  2. Type a jq query expression in the top filter bar (e.g. .items[] | select(.price > 50) | .name).

  3. View real-time evaluated results in the right output panel with syntax highlighting and latency metrics.

  4. Toggle CLI flags like -r (raw output), -s (slurp stream), -S (sort keys), -c (compact), or --tab formatting.

  5. Click "Recipes" to browse and apply 18+ pre-built patterns for grouping, aggregation, reshaping, and deduplication.

  6. Click "CLI Command" to generate and copy the exact terminal command ready for bash, zsh, or curl pipelines.

jq Playground & Filter Builder Features

  • Official jq 1.8.2 engine compiled to WebAssembly running 100% locally in your browser.

  • Multi-threaded background execution via WebWorkers to prevent UI freezes on massive payloads or intensive queries.

  • Comprehensive recipe cheatsheet library spanning property extraction, conditional filtering, grouping, aggregation, and deletion.

  • Interactive CLI flag toggles: Raw Strings (-r), Slurp Stream (-s), Sort Object Keys (-S), Compact Output (-c), and Tab Indentation (--tab).

  • Automatic JSONL stream detection with one-click slurp mode activation.

  • Zero server compute: completely private, offline-capable, and air-gapped — your sensitive JSON never leaves your device.

  • Query history persistence with instant one-click restoration across browser sessions.

  • Real-time output metrics showing execution latency (ms), line count, byte size, and result item count.

  • Full support for advanced functional jq constructs: group_by, to_entries, from_entries, unique, map, reduce, and del.

  • One-click CLI command generator with curl and file source modes for seamless terminal workflows.

  • URL state synchronization allowing shareable permalinks for any filter and flag combination.

  • Keyboard shortcuts for power-user speed: ⌘↵ (or Ctrl+Enter) to evaluate and ⌘⇧K to reset.

Supported Formats & Dialects

The jq Playground & Filter Builder supports 6 syntax formats and dialects for accurate parsing and processing.

Standard JSON Documents
Single root JSON objects or arrays formatted with 2-space indentation or custom tab spacing.
JSON Lines / JSONL Streams
Newline-delimited JSON streams (ndjson/jsonl) processed iteratively or slurped into a unified array with -s.
Raw Unquoted Strings (-r)
Outputs direct string values without wrapping quotes or JSON escape sequences, ready for shell piping.
Slurped Arrays (-s)
Concatenates multiple disparate JSON inputs or stream objects into a single top-level array before query execution.
Compact Minified JSON (-c)
Condenses evaluated JSON structures onto single lines without extraneous whitespace or linebreaks.
Key-Sorted Output (-S)
Normalizes and alphabetically sorts all object keys in the output for deterministic JSON diffing and comparisons.

Frequently Asked Questions

What is jq and what is it used for?
jq is a lightweight, flexible command-line JSON processor written in C. It allows developers to slice, filter, map, aggregate, and reshape structured JSON data with concise functional expressions, often described as sed and awk for JSON.
How does this online jq playground work without a backend server?
This playground compiles the official jq 1.8.2 C codebase directly into WebAssembly (Wasm) and runs it inside a background WebWorker thread in your browser. All query parsing, compilation, and evaluation happen on your CPU with zero network transmission.
What is the difference between jq and JSONPath?
JSONPath is primarily a declarative query selector designed to locate and extract specific nodes from a JSON tree. jq is a full functional programming language that can not only query but also perform arithmetic calculations, construct brand-new objects, group items, merge dictionaries, and handle multi-document streams.
How do I filter JSON array elements with conditions in jq?
Use the select() function. For example, .items[] | select(.status == "active" and .price < 100) iterates through every item in .items and emits only those satisfying the boolean condition. To keep the output wrapped as an array, use map(select(.status == "active")).
What is the difference between map(...) and .[] in jq?
The .[] operator unrolls an array into a stream of individual values, emitting each element separately. In contrast, map(f) applies the expression f to every element of an array and preserves the surrounding array container in the final output.
How do I group by a field and aggregate values in jq?
Use group_by() combined with map(). For example: group_by(.category) | map({ category: .[0].category, count: length, total_sales: (map(.price) | add) }) groups items by their category property and outputs an array of summary objects with counts and computed totals.
What does the -r (raw output) flag do in jq?
By default, jq outputs valid JSON strings surrounded by double quotes (e.g. "my-token"). When you enable the -r flag, jq outputs the raw string content directly without quotes or escape characters, making it ideal for piping into bash variables, curl commands, or environment configs.
What is the -s (slurp) flag and how does it handle JSONL streams?
Instead of evaluating the jq filter against each JSON object in an input stream independently, the -s (slurp) flag reads the entire stream of separate JSON objects into a single top-level array and executes the filter once against that array.
How do I remove sensitive or unwanted fields from JSON?
Use the del() function. For example, del(.password, .token, .secret) removes top-level secret fields. To recursively strip matching fields across all nested objects, use del(.. | .password?, .secret?).
How do I reshape nested JSON into a custom structure?
Use object construction syntax: .data | map({ id: .id, title: .attributes.title, author: .attributes.author.name }). You can combine field renaming, nesting, and computations inside a single declarative expression.
Is my JSON payload private and secure when using this tool?
Yes. 100% of data processing occurs client-side inside your browser via WebAssembly and WebWorkers. No JSON payload data, query expressions, or generated outputs are ever sent to, stored on, or inspected by our servers.
Can I export my playground query as a terminal CLI command?
Yes. Click the "CLI Command" button in the output toolbar to copy the exact jq terminal command with all active flags (such as -r, -s, -S, -c, --tab) formatted for immediate use in bash, zsh, or terminal pipelines.

Developer Reference & Learning Hubs