<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/using-jsonpath-with-system-text-json-to-query-json-in-net-pd3liujm6" -->

---
title: Using JsonPath with System.Text.Json to query JSON in .NET
description: A tutorial demonstrates how to use the Meziantou.Framework.JsonPath NuGet package to query System.Text.Json documents in .NET using standard JSONPath...
canonical: https://daily.dev/posts/using-jsonpath-with-system-text-json-to-query-json-in-net-pd3liujm6
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Using JsonPath with System.Text.Json to query JSON in .NET | daily.dev
og:description: A tutorial demonstrates how to use the Meziantou.Framework.JsonPath NuGet package to query System.Text.Json documents in .NET using standard JSONPath...
og:url: https://daily.dev/posts/using-jsonpath-with-system-text-json-to-query-json-in-net-pd3liujm6
og:image: https://api.daily.dev/og/posts/Pd3liUjM6.png
og:image:alt: Using JsonPath with System.Text.Json to query JSON in .NET
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Using JsonPath with System.Text.Json to query JSON in .NET

**[Meziantou](https://daily.dev/sources/meziantou)** · 2 min read · 10 upvotes · 1 comments

## Summary

A tutorial demonstrates how to use the Meziantou.Framework.JsonPath NuGet package to query System.Text.Json documents in .NET using standard JSONPath expressions defined by RFC 9535. It covers installation, parsing and evaluating expressions, the difference between lax and strict evaluation modes, and the range of supported JSONPath features such as filter selectors, descendant segments, and built-in functions like length(), count(), match(), search(), and value().

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.meziantou.net/using-jsonpath-with-system-text-json-to-query-json-in-dotnet.htm>

## Questions this post answers

### How do I run JSONPath queries against a System.Text.Json document in .NET?

Install the Meziantou.Framework.JsonPath NuGet package, parse a JSONPath expression with JsonPath.Parse, then call Evaluate against a JsonNode document. Each match returned includes the normalized path (like $['store']['book'][0]['title']) and the corresponding JSON value, letting you extract data from nested structures without manual traversal code.

_daily.dev surfaces practical .NET libraries like this for developers wrangling complex JSON structures._

### What is the difference between lax and strict JsonPath evaluation modes in Meziantou.Framework.JsonPath?

Lax mode, the default, returns no match when a path operation is invalid, such as querying a missing field, while strict mode throws a JsonPathEvaluationException instead. Lax mode suits optional or inconsistent JSON structures, while strict mode is better when missing fields should cause the code to fail immediately rather than silently return null.

_Developers choosing between fail-fast and tolerant JSON parsing strategies can find comparisons like this on daily.dev._

### Does Meziantou.Framework.JsonPath support the full JSONPath standard defined in RFC 9535?

Yes, it targets full RFC 9535 support, including property name, wildcard, index, slice, and filter selectors, child and descendant segments, filter expressions with comparisons and logical operators, and built-in functions like length(), count(), match(), search(), and value(), plus normalized output paths.

_daily.dev helps .NET developers track library updates before adopting a JSONPath implementation across projects._

## Community discussion

Top comments from developers on daily.dev.

**@agustinbarrientos** · 0 upvotes

> Could you add an example that shows how to tell a missing property from an explicit JSON null, without just looking at the returned value?

## Similar posts on daily.dev

- [Jaliya's Blog: EF Core 11.0: Querying JSON Columns with JsonPathExists and JsonContains](https://daily.dev/posts/jaliya-s-blog-ef-core-11-0-querying-json-columns-with-jsonpathexists-and-jsoncontains-sgbujxkxn) · We Are .NET · 1 upvotes · 0 comments
- [EF Core 11: Complex Types, JSON Queries, and JSON Indexes](https://daily.dev/posts/ef-core-11-complex-types-json-queries-and-json-indexes-mkqdiv0la) · We Are .NET · 5 upvotes · 0 comments
- [BoxLang 1.14.0 : Navigate Anything: JSONPath Comes to BoxLang’s DataNavigator](https://daily.dev/posts/boxlang-1-14-0-navigate-anything-jsonpath-comes-to-boxlang-s-datanavigator-zelcxbm30) · Foojay.io · 4 upvotes · 0 comments
- [Convert XML to JSON in C\# With Json.NET and Couchbase](https://daily.dev/posts/convert-xml-to-json-in-c-with-json-net-and-couchbase-vmp54ldyf) · Couchbase · 0 upvotes · 0 comments
- [Querying Roslyn syntax trees with XPath](https://daily.dev/posts/querying-roslyn-syntax-trees-with-xpath-31k1vo1ar) · Meziantou · 5 upvotes · 1 comments

---

Tags: [#.net](https://daily.dev/tags/.net), [#c#](https://daily.dev/tags/c#)

[View this post on daily.dev](https://daily.dev/posts/using-jsonpath-with-system-text-json-to-query-json-in-net-pd3liujm6)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Using JsonPath with System.Text.Json to query JSON in .NET","url":"https://daily.dev/posts/using-jsonpath-with-system-text-json-to-query-json-in-net-pd3liujm6","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/using-jsonpath-with-system-text-json-to-query-json-in-net-pd3liujm6"},"datePublished":"2026-09-21T12:12:21.074Z","dateModified":"2026-09-21T12:12:41.577Z","description":"A tutorial demonstrates how to use the Meziantou.Framework.JsonPath NuGet package to query System.Text.Json documents in .NET using standard JSONPath...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ba36c90040357c54e2f69c5867f7710b?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ba36c90040357c54e2f69c5867f7710b?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Meziantou","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Meziantou","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/1bdfdd5349654b08ab6fa3f1ac38192c","url":"https://daily.dev/sources/meziantou"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/using-jsonpath-with-system-text-json-to-query-json-in-net-pd3liujm6","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":10},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":".net,c#","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Meziantou","item":"https://daily.dev/sources/meziantou"},{"@type":"ListItem","position":3,"name":"Using JsonPath with System.Text.Json to query JSON in .NET"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/using-jsonpath-with-system-text-json-to-query-json-in-net-pd3liujm6","comment":[{"@type":"Comment","text":"Could you add an example that shows how to tell a missing property from an explicit JSON null, without just looking at the returned value?","datePublished":"2026-09-23T09:51:25.677Z","url":"https://daily.dev/posts/Pd3liUjM6#c-RL3G1n37w","author":{"@type":"Person","name":"Agustin Barrientos","url":"https://daily.dev/agustinbarrientos","image":"https://media.daily.dev/image/upload/s--5ayxQnqn--/f_auto/v1788281802/avatars/avatar_wQYYVe5Tbj0NJ7C7qPoa8?_a=BAMAMicg0"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/using-jsonpath-with-system-text-json-to-query-json-in-net-pd3liujm6#faq","mainEntity":[{"@type":"Question","name":"How do I run JSONPath queries against a System.Text.Json document in .NET?","acceptedAnswer":{"@type":"Answer","text":"Install the Meziantou.Framework.JsonPath NuGet package, parse a JSONPath expression with JsonPath.Parse, then call Evaluate against a JsonNode document. Each match returned includes the normalized path (like $['store']['book'][0]['title']) and the corresponding JSON value, letting you extract data from nested structures without manual traversal code. daily.dev surfaces practical .NET libraries like this for developers wrangling complex JSON structures."}},{"@type":"Question","name":"What is the difference between lax and strict JsonPath evaluation modes in Meziantou.Framework.JsonPath?","acceptedAnswer":{"@type":"Answer","text":"Lax mode, the default, returns no match when a path operation is invalid, such as querying a missing field, while strict mode throws a JsonPathEvaluationException instead. Lax mode suits optional or inconsistent JSON structures, while strict mode is better when missing fields should cause the code to fail immediately rather than silently return null. Developers choosing between fail-fast and tolerant JSON parsing strategies can find comparisons like this on daily.dev."}},{"@type":"Question","name":"Does Meziantou.Framework.JsonPath support the full JSONPath standard defined in RFC 9535?","acceptedAnswer":{"@type":"Answer","text":"Yes, it targets full RFC 9535 support, including property name, wildcard, index, slice, and filter selectors, child and descendant segments, filter expressions with comparisons and logical operators, and built-in functions like length(), count(), match(), search(), and value(), plus normalized output paths. daily.dev helps .NET developers track library updates before adopting a JSONPath implementation across projects."}}]}
```

