jq Filter Playground

A labeled jq subset.

Try the jq filters you use most on real JSON and see the result instantly. 2jq covers paths, pipes, select, length, and keys, and says clearly when a filter needs real jq.

Zero retention: your data never leaves this browser. Verify it yourself in DevTools

Loading the toolbox.

About 2jq

How Can You Verify That Nothing Leaves This Browser?

You do not have to take our word that your data stays here. Developer tools show every request a page makes, so you can watch this page work and confirm that nothing is sent. The check takes under a minute.

  1. Open your browser developer tools with F12, or Cmd+Option+I on a Mac, and select the Network tab.
  2. Reload the page and let it finish. You will see the page's own files, its web fonts, and one anonymous page-view request. Nothing has been typed yet, so none of them can contain your data.
  3. Click the clear icon in the Network tab so that the log is empty.
  4. Use the tool with your own input.
  5. Look at the Network tab again. It is still empty. For extra proof, turn on offline mode after the page loads and the tool keeps working.

Only two things can add a line to that log, and neither carries your data. Submitting the feedback form sends the vote and comment you typed. Typing characters in a script the page has not displayed yet, such as Cyrillic or Greek, can make the browser fetch the matching font file, and that request names only the font.

The production site also sends a Content-Security-Policy header that tells your browser to refuse connections to anywhere except this site and the anonymous analytics endpoint, so a coding mistake could not quietly send your data elsewhere.

What Is jq?

jq is a command-line JSON processor, often described as sed for JSON. A filter reads JSON and produces JSON: .user.name picks a field, .items[] walks an array, and | pipes one filter into the next, so .items[] | select(.active==true) | .name lists the names of active items.

It is a full programming language, with functions, variables, reduce, path expressions, and string formatting.

What Does the 2jq Subset Support?

  • Identity ., field paths such as .a.b, and array indexes including negative ones such as .[-1].
  • Iteration with .[] over arrays and objects.
  • Pipes with |.
  • select(...) with == and != comparisons against numbers, strings, true, false, and null.
  • length and keys.

jq streams results one per line; 2jq gathers a stream into a JSON array so it can be copied as one value. Anything outside the subset, such as map, reduce, or arithmetic, gives an error that names the supported features instead of a wrong answer.

Why a Subset Instead of Full jq?

A complete jq engine is a large project, and a partial one that guesses is worse than none. The subset covers the filters people reach for while exploring an API response, and its boundaries are stated on the page. For deep JSON work, including formatting, validation, and schema checks, use 2json, the full JSON workbench in the same family, or install jq itself.

What Are Some Useful Filters?

  • .items | length counts the items.
  • .items[0] and .items[-1] return the first and last items.
  • .items[].name lists one field from every item.
  • keys lists the top-level keys.
  • .[] returns every value of an object or array.

What Other Tools Are in the Checkers Lane?

  • 2xml: Format, minify, and validate XML with line and column errors, namespace lint, and JSON conversion.
  • 2ssh: Validate ssh_config or sshd_config, copy a hardened block, and compose the right ssh-keygen command.
  • 2dotenv: Find duplicate keys, empty values, and quoting bugs, diff against .env.example, and generate one.
  • 2kbd: Press any key to see key, code, keyCode, location, and modifiers, with a copy-ready handler.

Elsewhere in the toolbox: 2uuid, 2gitignore, 2csp, 2htaccess, and more on the 2toolbox home page. Part of the 2suite.io privacy-first ecosystem.

Frequently Asked Questions

Is 2jq the real jq?

No. It is a clearly labeled subset written in JavaScript. Results match jq for the supported filters, shown as an array where jq would print a stream.

Why does map() give an error?

map is outside the subset. Use .items[].field, which gives the same result here, or use real jq.

Is my JSON sent anywhere?

No. Parsing and filtering happen on this page.

Where can I do more with JSON?

2json, the sister JSON workbench, handles formatting, validation, and deeper analysis.

Was this helpful?