jq query tool

jq Query Tool Online – Filter and Transform JSON Easily

Large JSON documents often contain more information than you actually need.

Captain JSON’s jq Query tool helps you filter, transform, and reshape JSON using familiar jq-style expressions.

Explore data, extract relevant values, and simplify complex JSON structures with a live query preview.

  • 100% offline
  • Privacy first
  • Nothing uploaded

Part of the Captain JSON toolkit — 20+ JSON tools in one extension.

Example: list every item name

Illustrative example
jq expression
.items | map(.name)
Output
[  "Keyboard",  "Monitor",  "Mouse"]
Cross Browser Support

Available Across All Major Browsers

Your JSON toolkit. Wherever you develop.

Captain JSON brings essential JSON developer utilities into your everyday browser workflow. Explore JSONPath expressions, filter JSON using jq-style queries, and transform complex JSON structures into readable tables. Install Captain JSON on your preferred supported browser and make JSON exploration easier.

Available today: Google Chrome, Microsoft Edge and Mozilla Firefox. More browsers are coming soon.

What is jq?

jq is a lightweight command-line JSON processor: you give it a filter and it selects, filters and transforms JSON. Captain JSON’s jq Query tool brings jq-style expressions into your browser, with a lightweight interpreter for common jq operations and a live output panel. It is not a full jq installation, so it covers common operations rather than the whole jq language.

About Captain JSON: Captain JSON is a browser extension by PiratesOfBugs that provides JSON developer utilities including JSON comparison, formatting, pretty printing and validation.

Features

jq query tool features

Filter and reshape JSON with jq-style expressions, and see the result as you work.

  • Execute jq-like filters

    Run jq-style expressions against your JSON.

  • Live preview and output panel

    Inspect the transformed JSON in a live output panel.

  • Built-in examples

    Start from ready-made expressions and adapt them.

  • Query history

    Return to expressions you ran earlier.

  • Copy or download results

    Copy the result or download it.

  • Lightweight interpreter for common jq operations

    Covers field selection, array indexing, filtering, mapping, sorting, grouping and length — not every jq feature.

Problem & solution

Extract the Data You Need Without Manually Editing JSON.

The problem

Working with large API responses can make data analysis and debugging unnecessarily complicated.

You may need only a few fields from a large JSON object, or you may need to filter an array based on specific conditions.

How Captain JSON helps

jq-style expressions make these operations easier.

Captain JSON provides an interactive query environment where you can execute expressions and inspect transformed JSON through a live output panel.

  • Live preview and output panel
  • Built-in examples and query history
  • Runs locally — your JSON never leaves the browser
Use cases

What Can You Do With jq Queries?

  • JSON Filtering

    Filter objects and arrays using conditions.

  • Data Transformation

    Reshape JSON into the structure you need.

  • API Response Cleanup

    Extract only relevant API response fields.

  • Automation Workflows

    Prepare JSON data for automation and testing.

  • JSON Exploration

    Quickly understand complex JSON structures.

How to use

How to Filter JSON Using jq Expressions

  1. Step 1

    Open Captain JSON

  2. Step 2

    Navigate to jq Query

  3. Step 3

    Load or paste a JSON document

  4. Step 4

    Enter your jq-style expression

  5. Step 5

    Execute the query

  6. Step 6

    Review the transformed output in the preview panel

  7. Step 7

    Reuse built-in examples or query history where applicable

Examples

jq examples: original JSON, expression and result

These illustrative examples use operations Captain JSON documents for its lightweight interpreter — field selection, filtering, mapping and sorting. They are examples, not screenshots of the extension.

Original JSON
{  "user": { "name": "Ada Lovelace", "email": "[email protected]" },  "items": [    { "name": "Keyboard", "price": 49.9, "inStock": true },    { "name": "Monitor", "price": 189, "inStock": false },    { "name": "Mouse", "price": 19.5, "inStock": true }  ]}

Extract a single property

Illustrative example

Field selection walks down to one value.

jq expression
.user.name
Result
"Ada Lovelace"

Filter an array using a condition

Illustrative example

Keep only the items that cost more than 20.

jq expression
.items | map(select(.price > 20))
Result
[  {    "name": "Keyboard",    "price": 49.9,    "inStock": true  },  {    "name": "Monitor",    "price": 189,    "inStock": false  }]

Select one field from every object

Illustrative example

Map over the array and keep just the name of each item.

jq expression
.items | map(.name)
Result
[  "Keyboard",  "Monitor",  "Mouse"]

Transform an array into a simplified structure

Illustrative example

Sort by price, then keep only the names: a short, ordered list instead of full objects.

jq expression
.items | sort_by(.price) | map(.name)
Result
[  "Mouse",  "Keyboard",  "Monitor"]
FAQ

jq query: frequently asked questions

What is jq?

jq is a lightweight command-line JSON processor. You write a filter and jq uses it to select, filter and transform JSON — for example .items | map(.name) returns an array of names. Captain JSON’s jq Query tool brings jq-style expressions into your browser.

What is a jq query?

A jq query, also called a filter, is an expression applied to JSON input that produces output. Filters can pick fields (.user.name), index arrays (.items[0]), keep matching items with select(...), map over arrays and chain steps with the pipe character.

How do I filter JSON online?

Load your JSON in Captain JSON, open jq Query and enter a filter such as .items | map(select(.price > 20)). The live output panel shows the filtered result. Everything runs in your browser, so your JSON is never uploaded.

How can I extract specific fields from JSON?

Use field selection: .user.name returns a single value, and .items | map(.name) returns that field from every object in an array. To locate a value by its path instead, see the JSONPath Query tool.

What is the difference between jq and JSONPath?

jq is a filter language: it can select fields, filter with conditions, map and reshape arrays, sort, group and compute values. JSONPath is a path syntax that returns the values found at matching locations. Use JSONPath to locate data and jq to transform it. Captain JSON offers both — see JSONPath Query.

Can jq transform JSON data?

Yes. Beyond filtering, jq can map over arrays, sort with sort_by, group with group_by and compute lengths with length to reshape data. Captain JSON’s lightweight interpreter covers common operations of this kind: field selection, array indexing, filtering, mapping, sorting, grouping and length calculations.

How do I test jq expressions online?

Paste a representative sample of your JSON, enter the expression and read the live output. Start from the built-in examples and use query history to revisit variations. Captain JSON implements common jq operations rather than the full language, so confirm a final filter in jq itself before relying on it in a script.

Is jq useful for API testing?

Yes. jq-style filters help you pull the fields a test cares about out of a large response, or trim a payload to a readable subset before you compare it with an expected result using JSON Compare. Captain JSON helps you prototype the expression before you use it in your own tooling.

Does Captain JSON support every jq feature?

No. Captain JSON uses a lightweight interpreter for common jq operations — field selection, array indexing, filtering, mapping, sorting, grouping and length calculations. It does not claim full jq compatibility, so if you rely on advanced jq features, test them in jq itself.

One Toolkit. More Control Over Your JSON.

From exploring nested JSON to filtering complex data and converting structures into readable tables, Captain JSON brings essential JSON utilities together in one browser extension.

  • ✓ 100% Offline
  • ✓ Privacy First
  • ✓ Lightweight

We use analytics cookies to understand how the site is used. No personal data is sold. See our privacy practices before choosing.