# JSONPath Query Tool

Query arbitrary JSON with JSONPath expressions, preview matches, switch output modes, and save reusable query templates

> Canonical page: https://elysiatools.com/en/tools/jsonpath-query-tool

- **Category:** Development

- **Keywords:** jsonpath, json query, api, nested json, template, extract

## Overview

The JSONPath Query Tool allows developers and data analysts to extract specific data from complex, nested JSON payloads using standard JSONPath expressions. You can instantly preview matches, format the output as JSON, structured tables, or Markdown, and save frequently used queries as reusable templates for faster API debugging and data extraction.

## Inputs

- **JSON Input** (textarea): { "store": { "book": \[{ "author": "Nigel Rees" }\] } }
- **JSONPath Expression** (text)
- **Output Format** (select)
- **Maximum Matches** (number)
- **Save Query Template** (checkbox)
- **Template Name** (text): Store authors

## When to use

- When you need to extract specific fields or arrays from deeply nested API responses.
- When filtering large JSON datasets based on specific conditions, such as user roles or active statuses.
- When generating Markdown or table reports directly from raw JSON data without writing custom scripts.

## How it works

- Paste your raw JSON payload into the input area.
- Enter a valid JSONPath expression to target the specific nodes or arrays you want to extract.
- Select your preferred output format, such as JSON, Table, or Markdown, and set a maximum match limit.
- View the extracted results instantly and optionally save the query as a template for future use.

## Use cases

- Extracting a list of specific IDs or names from a large, nested API response.
- Filtering user or product arrays to find records matching specific attributes.
- Converting raw JSON configuration files into readable Markdown documentation.

## Frequently asked questions

### What is JSONPath?

JSONPath is a query language for JSON, similar to XPath for XML, that allows you to select and extract specific data from complex JSON structures.

### Can I format the extracted data?

Yes, you can choose to output the matched results as raw JSON, a structured table, or Markdown blocks.

### Is there a limit to the number of matches returned?

You can configure the maximum number of matches to return, ranging from 1 up to 500 results per query.

### How do query templates work?

By checking the 'Save Query Template' option and providing a name, you can save your JSONPath expression to quickly reuse it on future JSON payloads.

### Can I filter arrays based on specific values?

Yes, JSONPath supports filter expressions like `[?(@.role == "admin")]` to extract only the objects that meet your specific criteria.

## Related tools

- [JSON Schema to Zod Schema Converter](https://elysiatools.com/en/tools/json-schema-to-zod-schema-converter): Convert JSON Schema JSON/YAML definitions into ready-to-use Zod schemas with nested objects, arrays, enums, and common validation rules
- [ECharts Theme Token Extractor](https://elysiatools.com/en/tools/echarts-theme-token-extractor): Extract design tokens — colors, numbers, font sizes and strings — from an ECharts theme JSON and export them straight into your design system. Paste a theme object (the kind registered via echarts.init(dom, themeName)) and the tool walks every leaf, tagging each color (with optional named/rgb → hex normalization), spacing number, font size and string, then emits clean CSS variables, a Tailwind theme.extend config, Style Dictionary tokens.json, or SCSS variables. Bridges the gap between an ECharts visualization theme and Figma/CSS/Tailwind design tokens without copying each value by hand.
- [Image Palette to Design Tokens](https://elysiatools.com/en/tools/image-to-design-tokens): Extract a dominant color palette from an image (k-means clustering), then export it as CSS variables, SCSS variables, a Tailwind config, or JSON design tokens — with named colors and an auto-generated shade scale for each
- [JSON Path Extractor](https://elysiatools.com/en/tools/json-path-extractor): Query JSON with JSONPath or JMESPath-style expressions, inspect matched paths, and highlight extracted values in the original document
- [JSON Diff Visualizer](https://elysiatools.com/en/tools/json-diff-visualizer): Compare two JSON payloads and render a visual HTML diff with path-level additions, removals, changes, and statistics
- [JSON Key Extractor](https://elysiatools.com/en/tools/json-key-extractor): Extract all keys from JSON objects with multiple output formats. Perfect for analyzing JSON structure, documentation generation, and understanding complex nested objects.
- [JSON Pointer Tool](https://elysiatools.com/en/tools/json-pointer): Navigate and extract values from JSON using JSON Pointer (RFC 6901)
- [JSONPath REPL Playground](https://elysiatools.com/en/tools/jsonpath-repl-playground): An interactive JSONPath REPL that runs multi-step query pipelines against any JSON. Write one JSONPath expression per line (e.g. $..book\[?(@.price<10)\] then $\[0:5\]) and see each step's matches with counts, paths, and values — plus a shareable URL that encodes your data and pipeline. Supports recursive descent ($..), wildcards (\[*\]), filters (\[?(@.price<10)\]), slices (\[0:5:2\]), and negative indices.

## Samples

- [JWT Samples](https://elysiatools.com/en/samples/jwt-samples): Comprehensive JWT examples from basic token structure to advanced security implementations
- [Postman Collections - API Testing](https://elysiatools.com/en/samples/postman-collections): Comprehensive Postman collection examples including API testing, automation scripts, environment variables, mock servers, and advanced testing patterns for REST APIs
- [Terraform Plan JSON Samples](https://elysiatools.com/en/samples/terraform-plan-json-samples): Sample Terraform plan JSON files exported from terraform show -json style payloads for dependency visualization and change review
- [macOS Networking Objective-C Samples](https://elysiatools.com/en/samples/macos-networking-objectivec): macOS Objective-C networking examples including URLSession, HTTP requests, WebSocket, and network reachability

## Related content

- [JSON Schema, Mock Data, and API Fixture Generators](https://elysiatools.com/en/hubs/json-generate): Curated tools for JSON schema generation, mock payload building, and API fixture preparation in one hub.
- [JSON Interchange and Format Translation Tools](https://elysiatools.com/en/hubs/json-convert): Compare JSON conversion tools for CSV, YAML, TOML, GraphQL, XML, Markdown, Excel, BSON, EDN, and related structured formats in one hub.
- [JSON Inspection, Diff, and Transformation Tools](https://elysiatools.com/en/hubs/json-utility): Compare JSON formatting, diffing, path inspection, schema validation, merging, transformation, and export tools in one hub for API and data workflows.
- [JSON Formatting, Diff, and Normalization Tools](https://elysiatools.com/en/hubs/json-format): Compare JSON formatting, diffing, log review, config comparison, and data-normalization tools in one hub for readable and reviewable JSON workflows.
