# JSON Path Extractor

Query JSON with JSONPath or JMESPath-style expressions, inspect matched paths, and highlight extracted values in the original document

> Canonical page: https://elysiatools.com/en/tools/json-path-extractor

- **Category:** Data Processing

- **Keywords:** json, jsonpath, jmespath, query, extract, highlight, api

## Overview

The JSON Path Extractor allows developers and data analysts to query complex JSON documents using JSONPath or JMESPath expressions. It instantly evaluates your queries, extracts matching nodes, and highlights the results directly within the original JSON structure for easy visual inspection and debugging.

## Inputs

- **JSON Input** (textarea): { "users": \[ { "name": "Ada", "role": "admin" } \] }
- **Query Expressions** (textarea): Use one expression per line. Supports field access, array indexes, wildcards, and simple filters.
- **Query Engine** (select)
- **Display Mode** (select)
- **Flatten Array Results** (checkbox)
- **Include Null Values** (checkbox)
- **Maximum Matches** (number)

## When to use

- When you need to extract specific fields or objects from deeply nested API responses.
- When filtering large JSON arrays based on conditional logic, such as finding items over a certain value.
- When testing and debugging JSONPath or JMESPath expressions before implementing them in your application code.

## How it works

- Paste your raw JSON payload into the input area.
- Enter one or more JSONPath or JMESPath expressions, placing each on a new line.
- Select your preferred query engine and adjust settings like array flattening or null value inclusion.
- Review the extracted data either as a list of matches or highlighted directly within the original JSON.

## Use cases

- Extracting user IDs or email addresses from a bulk user export JSON file.
- Filtering server log JSON arrays to find entries with specific error codes or severity levels.
- Validating data extraction logic for automated testing scripts or API integrations.

## Frequently asked questions

### What is the difference between JSONPath and JMESPath?

JSONPath is a standard query language for JSON, often using `$.` syntax. JMESPath is another query language optimized for complex filtering and transformations, commonly used in tools like the AWS CLI.

### Can I run multiple queries at once?

Yes, you can enter multiple expressions by placing each one on a new line in the query input field.

### What does the 'Flatten Array Results' option do?

It merges nested arrays returned by your queries into a single, flat list, making it easier to read and copy the extracted values.

### How are the results displayed?

You can choose 'Highlighted JSON' to see matches colored within your original input, or 'Match List' to see only the extracted values and their exact paths.

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

Yes, to ensure performance, the tool limits the output to a maximum number of matches, which you can adjust up to 200 using the settings.

## Related tools

- [Structured Log Analyzer](https://elysiatools.com/en/tools/structured-log-analyzer): Detect common log formats, extract core fields, infer field types, and export parsed logs as JSON, CSV, or SQL inserts
- [Excel Formula Evaluator](https://elysiatools.com/en/tools/excel-formula-evaluator): Evaluate bounded Excel-style formulas against JSON cell values and explain results, references, and spreadsheet errors.
- [JWK Generator & Parser](https://elysiatools.com/en/tools/jwk-generator): Generate JSON Web Keys (JWK) for RSA, EC (P-256/P-384/P-521/secp256k1), and OKP (Ed25519/Ed448/X25519/X448), or parse an existing JWK to inspect its parameters, thumbprint, and metadata
- [package.json Dependency Auditor](https://elysiatools.com/en/tools/package-json-dependency-auditor): Audit a package.json for dependency hygiene, version-range quality, and optionally inspect a transitive dependency tree from package-lock.json or yarn.lock. Flags duplicates, wildcard or pre-release specs, unsorted keys, missing metadata, and misclassified runtime/dev dependencies.
- [CSV Filter](https://elysiatools.com/en/tools/csv-filter): Filter CSV data by column values with multiple conditions and operators. Supports 12 filter operators including equals, contains, greater_than, less_than, and empty value checks. Additional Filters examples: \[{"column": "age", "operator": "greater_than", "value": "25"}\] \[{"column": "status", "operator": "equals", "value": "active"}, {"column": "score", "operator": "greater_equal", "value": "80"}\] \[{"column": "name", "operator": "contains", "value": "john"}, {"column": "email", "operator": "is_not_empty"}\]
- [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.
- [PDF Table Extractor to CSV/JSON](https://elysiatools.com/en/tools/pdf-table-extractor-to-csv-json): Extract tables from PDFs with OpenDataLoader and export them as structured JSON, flat CSV, or HTML tables
- [3D Model Viewer & Inspector](https://elysiatools.com/en/tools/3d-model-viewer): Upload an STL, OBJ, GLB or glTF model: exact vertex/triangle counts, bounding-box dimensions, materials, animations and node tree, plus an interactive Three.js viewer (rotate, zoom, shaded/wireframe/normals).

## Samples

- [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
- [Chat Transcript JSON Samples](https://elysiatools.com/en/samples/chat-transcript-json): JSON examples for multi-role chat transcripts
- [JSON Samples](https://elysiatools.com/en/samples/json): JSON (JavaScript Object Notation) format examples from simple to complex structures
- [Rich Media JSON Samples](https://elysiatools.com/en/samples/rich-media-json): JSON examples for popular rich text editors (TipTap, Quill, Slate)
