Skip to content
Marvin's Toolbox.

Search tools

Type to filter all tools

jq Playground

Run real jq filters against JSON in your browser. Write a filter, pass options like slurp or raw output, browse a built-in cheat sheet of common filters, and copy the result or send it to another tool.

Everything runs locally in your browser. Your data never leaves your device.

Filter and options

Available in the filter as $name
Running your filter
The first run also loads the jq engine, so it can take a moment.

Cheat sheet

Click an example to load its filter, a matching sample input and the flags it needs.

Next steps

Send this tool's output straight into another tool.

Paste JSON to explore it as a collapsible, searchable tree, hide the fields you don't need, and see the structure it implies as a badge-annotated schema and a copyable TypeScript interface.

Try JSONPath queries against your own JSON and see the matches instantly. Every result comes with its normalized path, sample queries help you get started, and the matches are ready to copy or send onward as JSON.

Convert config and data between JSON, YAML, TOML, JSON5, INI, XML, CSV and .env. Type or paste on the left, pick the output format on the right, and copy the result. Includes a format button and a minify toggle.

Compare two JSON documents by structure and see every added, removed and changed key and value with its exact path. Browse the result as a tree, a filterable change list or a line diff, ignore array order, catch type changes and export the changes as a JSON report.

Convert text into every case at once: title case in the APA, AP, Chicago, MLA, Bluebook, AMA and NYT styles, sentence case, upper, lower, camelCase, snake_case, kebab-case and more.

Count words, characters, sentences, paragraphs, lines and more as you type, with estimated reading and speaking time.

Remove duplicate lines from a list or text, keeping the first occurrence. Optionally ignore case and whitespace, or drop blank lines too.

Replace text in two modes: plain find and replace all, or regular expressions with flag controls and capture group references like $1.

Compare two texts and see every added, removed and changed line highlighted, side by side or inline, with the changed words marked within each line. Ignore case, whitespace or blank lines, read a summary of how much changed, and export the result as a unified diff.

About the jq Playground Tool

This tool runs real jq against your JSON, live as you type. It is the actual jq 1.8 binary compiled to WebAssembly, not a lookalike, so filters behave exactly as they do on the command line and error messages are the ones jq itself prints.

Write a filter, toggle the flags you would pass on the CLI, and read the result next to the input. A cheat sheet of everyday filters loads working examples with matching sample data, which makes it a quick way to learn jq too.

What you can do

  • Test a jq filter before using it in a script or pipeline.
  • Run jq without installing it.
  • Use CLI flags as toggles: raw output, slurp, compact, sort keys, null input and tab indent.
  • Pass values into the filter with named --arg variables.
  • Learn common patterns from the cheat sheet: select, map, group_by, to_entries, string interpolation and CSV or TSV export.
  • Copy the finished filter as a ready-to-paste jq shell command.

How to use the jq Playground

  1. 1Paste JSON into the input pane, or send it over from another tool.
  2. 2Write the filter. The output updates shortly after you stop typing.
  3. 3Toggle the flags the filter needs, like raw output for plain strings or slurp for a stream of documents.
  4. 4Add --arg variables if the filter should take values from outside.
  5. 5Copy or download the result, copy the shell command, or send the output to the next tool.

The same flags as the command line

The toggles map one to one onto jq's CLI flags. Raw output (-r) prints strings without quotes, which is what you want when the result feeds a shell script. Slurp (-s) gathers a whole stream of JSON documents, like line-delimited logs, into one array before the filter runs. Compact (-c) puts each result on a single line, sort keys (-S) makes output diffable, null input (-n) runs the filter without reading the input at all, and tab indent (--tab) switches the pretty-printer to tabs.

Named variables work like --arg name value on the CLI and appear in the filter as $name. They arrive as strings, so pipe them through tonumber when you compare against numbers.

Errors are jq's own

When a filter does not compile or fails at runtime, the panel shows jq's error text verbatim, including the caret that points at the offending spot. Those messages are the fastest way to fix a filter, so nothing rewrites or shortens them. Warnings from debug show up separately without failing the run.

Filters that never finish, like repeat without a limit, are stopped after ten seconds instead of freezing the page.

Where the result can go

The output is offered to other tools as JSON when the whole result parses as one value, and as plain text otherwise, for example raw strings, @csv rows or a stream of several values. Send extracted data to the JSON Inspector to explore it as a tree. If you prefer path queries over a filter language, the JSONPath Playground covers the same ground with JSONPath.

Credits

Open source does the heavy lifting in this tool. Thank you to:

  • jq

    The command-line JSON processor, a whole little language for slicing and transforming JSON.

Everything this site builds on is listed on the credits page.

Convert config and data between JSON, YAML, TOML, JSON5, INI, XML, CSV and .env. Type or paste on the left, pick the output format on the right, and copy the result. Includes a format button and a minify toggle.

Compare two JSON documents by structure and see every added, removed and changed key and value with its exact path. Browse the result as a tree, a filterable change list or a line diff, ignore array order, catch type changes and export the changes as a JSON report.

Paste JSON to explore it as a collapsible, searchable tree, hide the fields you don't need, and see the structure it implies as a badge-annotated schema and a copyable TypeScript interface.

Validate JSON against a JSON Schema and see every violation with its exact path, the failing rule and a plain explanation. Supports draft-07 through 2020-12 with format checks, and can infer a starter schema from your data.

Paste JSON and get matching TypeScript types, with interfaces or type aliases, optional readonly fields and comments showing example values detected in your data. Nested objects become their own named types.

Try JSONPath queries against your own JSON and see the matches instantly. Every result comes with its normalized path, sample queries help you get started, and the matches are ready to copy or send onward as JSON.