Home → JSON Value Extractor

JSON Value Extractor

Extract deeply nested values from JSON using dot notation paths.

About This Tool

Extract deeply nested values from JSON using dot notation paths. This tool runs entirely in your browser — no data is ever sent to a server. Free to use, no account required.

How the JSON Value Extractor Works

The extractor lets you pull specific values out of JSON using path expressions, without navigating the entire document in code.

Dot-Notation Paths

Access nested values using dot notation like user.address.city or data[0].name. Simple, readable, and familiar to JavaScript developers. Supports array index notation for specific elements.

JSONPath Expressions

Use JSONPath syntax for powerful queries, including wildcards ($.items[*].price), filters ($.items[?(@.price > 10)]), and recursive descent (..name). JSONPath can return multiple values from a single expression.

Extracting Multiple Values at Once

The extractor can retrieve several fields simultaneously, building a new, smaller JSON object from the extracted values.

Batch Extraction

Specify multiple paths and extract all of them in one operation. The output is a new JSON object containing only the extracted fields — useful for transforming a large API response into a minimal object.

Flattening Nested Data

Pull deeply nested values up to the top level, which is useful when you need a flat structure for a CSV export, spreadsheet, or database insert.

Frequently Asked Questions

What is JSON value extraction?+
JSON value extraction means pulling one or more specific values out of a JSON document by specifying their location using a path expression. Instead of loading the entire JSON into your code and navigating it manually, you provide a path like user.profile.email and the tool returns just that value.
What path syntax does the extractor support?+
The extractor supports both simple dot-notation paths (user.name, items[0].price) and full JSONPath expressions ($.store.book[*].author). JSONPath provides more power, including wildcards, array slicing, and conditional filters. For simple extractions, dot-notation is easier to read and write.
Can I extract values from arrays?+
Yes. Use array index notation to access a specific element (items[0]), a wildcard to get all elements (items[*]), or a slice (items[0:5]) for a range. Combined with filters, you can extract only elements matching a condition, such as all orders with status 'completed'.
Is the JSON value extractor the same as JSONPath?+
JSONPath is the query language used for extraction, while the value extractor is the tool that applies JSONPath queries to your data. Think of JSONPath as SQL and the value extractor as the query runner.

JSONPath Expression Reference

JSONPath (RFC 9535) is a query language for JSON, similar to XPath for XML. It's used to extract specific values from complex nested JSON structures.

JSONPath Syntax Examples

// JSON Document
{
  "store": {
    "books": [
      {"title": "JSON Guide", "price": 9.99, "inStock": true},
      {"title": "Go Patterns", "price": 14.99, "inStock": false},
      {"title": "API Design", "price": 12.99, "inStock": true}
    ]
  }
}

// JSONPath Expressions
$.store.books[*].title          // All titles
$.store.books[0].price          // First book price: 9.99
$.store.books[-1].title         // Last book: "API Design"
$.store.books[?(@.inStock)].title // In-stock: ["JSON Guide","API Design"]
$.store.books[?(@.price < 13)].title // Under $13: ["JSON Guide","API Design"]
$..price                         // All prices: [9.99, 14.99, 12.99]

JSONPath Operator Reference

OperatorMeaning
$Root element
.Child operator (dot notation)
[]Child/subscript operator
[*]All elements of array
..Recursive descent (all descendants)
[n]Array element at index n
[n:m]Array slice from n to m
[?(@.key)]Filter: elements where key exists
[?(@.key == val)]Filter: elements where key equals val

JSONPath in JavaScript

// npm install jsonpath-plus
import { JSONPath } from "jsonpath-plus";

const titles = JSONPath({ path: "$.store.books[*].title", json: doc });
console.log(titles); // ["JSON Guide", "Go Patterns", "API Design"]

// Filter
const cheap = JSONPath({ path: "$.store.books[?(@.price < 13)]", json: doc });

Value Extraction Patterns

The value extractor recursively searches all depths of a JSON document for a given key name, collecting every matching value regardless of where it is nested.

{
  "company": "Acme",
  "departments": [
    {"name": "Engineering", "employees": [
      {"id": 1, "email": "alice@acme.com"},
      {"id": 2, "email": "bob@acme.com"}
    ]},
    {"name": "Marketing", "employees": [
      {"id": 3, "email": "carol@acme.com"}
    ]}
  ]
}
Extract key "email":
→ ["alice@acme.com", "bob@acme.com", "carol@acme.com"]  (from all depths)

Extract key "id":
→ [1, 2, 3]

Extract key "name":
→ ["Engineering", "Marketing"]

Extract key "employees":
→ [[{id:1,...},{id:2,...}], [{id:3,...}]]

Value Extractor vs JSONPath

The value extractor is designed for simplicity — just enter a key name and get all matching values. JSONPath offers more power but requires learning its query syntax.

Feature Value Extractor JSONPath
Syntax neededNone — just key nameYes — must know path syntax
Multiple matchesAlways returns allDepends on expression
Nested depthAll depths automaticallyMust use .. for recursion
Best for"Find me all X" searchesPrecise path targeting
Use caseData explorationData pipeline extraction

Explore more tools: All JSON Tools | Validator | Pretty Print | JSON Diff