JSON Query Builder

Build JSONPath queries visually with filter, slice and recursive search operators, get jq and other language equivalents, and preview matches against pasted JSON data.

FreeOnline Tool
Loading…

How to Use

Choose the 'JSONPath' or 'jq' style. In JSONPath mode, build the path step by step with the buttons for child keys (.key), wildcards ([*]), recursive search (..key), filters ([?(@.key==v)]), slices ([0:5]) and indexes ([0]), undoing the last step at any time. Equivalent expressions for JavaScript, jq and Python are shown live next to it. In jq mode, type the expression and insert common operators with one click. Paste JSON into the 'Test data' box and the query runs automatically, showing the match count and matched values. 'Load sample data' demonstrates the full flow.

Features

  • Visual, step-by-step JSONPath building with child, wildcard, filter, slice and index operators
  • Live equivalents for JavaScript, jq and Python
  • Automatic query execution against pasted JSON with match counts
  • Built-in lightweight JSONPath evaluator with recursive search and numeric comparisons
  • Quick-insert buttons for common jq operators

Use Cases

Extract data from API responses
Build the right path for deeply nested JSON responses and copy the equivalent code into your program
Learn JSONPath syntax
Try each operator as a segment and watch the match results update to understand what every step does
Port queries to jq scripts
Verify a path in the browser, then paste the jq expression into a shell pipeline or ops script
Verify response shapes during integration
Paste an API response with the expected path to confirm the field exists and check its value and count

FAQ

What is the difference between JSONPath and jq?
JSONPath uses $-prefixed path syntax, while jq is a command-line tool syntax starting with . and combining operations with pipes. The tool supports both styles and can run matches against test data
Can I use the generated JavaScript or Python code directly?
Those outputs are references: JavaScript shows the path and guidance, Python shows how to use the jsonpath-ng library. Running them requires importing the corresponding library
Why do jq-mode previews still use JSONPath syntax?
The match preview uses a built-in lightweight evaluator that mainly implements JSONPath. For exact behavior, run jq expressions in a real jq environment
Which comparison operators do filters support?
==, !=, >, <, >= and <=. Numeric comparisons convert values to numbers first, while equality compares values as strings