RunLocalTools

JSONPath Tester: Run and Debug JSONPath Queries Online

Free JSONPath tester with live match highlighting, a clickable tree, RFC 9535 syntax and exports. Runs in your browser, so your JSON is never uploaded.


What it does

Paste or drop some JSON, type a JSONPath query such as $.store.book[?@.price < 10].title, and see every match instantly. Each match shows its exact location (the normalized path), its type and its value, and the matching parts are highlighted right inside your source text so you can see what the query actually picked.

You can switch between a card list, a plain values array, a list of paths, or path-and-value pairs, then copy the output or download it as JSON, a text list of paths, or CSV. Matches that are flat objects can also be sent straight to other tools on this site as a table.

Beyond the basic tester, you also get a clickable tree of your document (click any node to turn it into a query), a plain-English explanation of what your query does, a batch runner for many queries at once, saved queries with history, and ready-to-paste code for JavaScript, Python and Java.

How it works

The tester has its own JSONPath engine that implements RFC 9535, the 2024 IETF standard for JSONPath. It covers child and recursive-descent segments, wildcards, negative indices, slices with negative steps, unions, and filters with ==, !=, <, <=, >, >=, &&, ||, ! and nested sub-queries. The five standard functions are included too: length(), count(), match(), search() and value(). The engine was checked against the community RFC 9535 compliance test suite, all 706 cases.

The JSON parser records where every value starts and ends in your text. That is how matches can be highlighted exactly, and how a syntax error can point to its line and column with a caret under the offending character. Numbers keep the digits you wrote, so large IDs beyond JavaScript’s safe integer range are copied back unchanged.

Two optional modes go beyond the standard. Lenient parsing accepts comments and trailing commas. The extensions dialect adds the operators many older JSONPath tools offer: in, nin, contains, =~ /regex/flags, ~ (return the key of each match) and ^ (the parent of each match). The standard stays the default so you always know what is portable.

The engine has built-in guards. A step budget stops runaway queries on very large documents instead of freezing the tab, and regular expressions that look prone to catastrophic backtracking are flagged and only tested against short strings.

How to use it

  1. Add your JSON: paste it into the editor, drop a .json, .jsonc, .ndjson or .jsonl file onto the sidebar, or click Load sample to try the bookstore example.
  2. Type a query in the box at the top. Invalid queries show an error with a caret at the problem. Valid ones show a plain-English breakdown of each step.
  3. Read the results on the right. Click a result to jump to it in the source, or click inside the source to select the match under your cursor.
  4. Not sure what path you need? Open the Tree explorer and click a node to turn its location into the query. Shift+click gives a shorter dot path.
  5. Compare several queries at once in Batch queries, keep favourites in Saved & history, or copy a snippet from Code snippets.
  6. Copy or download the results from the sidebar. When you are done, press Clear saved JSON to delete what the page kept in your browser.

If your JSON needs tidying first, the JSON formatter and validator can reformat it, and when you want to see what changed between two API responses, the JSON diff tool shows it. The match() and search() filter functions take regular expressions, which you can try out in the regex tester before putting them into a query. Once a query returns the records you want, convert the JSON into a table or generate matching TypeScript types.

Supported formats

  • JSON (RFC 8259), with an optional lenient mode for comments (// and /* */) and trailing commas.
  • NDJSON / JSON Lines, auto-detected or chosen manually. Each line becomes an element of a top-level array, so $[*].id queries every record.
  • Large documents work (a 14 MB file parses in well under a second in testing); the page warns before a very large file may briefly pause the tab.

FAQ

What is the difference between JSONPath and jq?

JSONPath is a query syntax for picking values out of a JSON document, written as a path such as $.store.book[*].author. jq is a full command-line language that can also reshape, calculate and transform data. If you only need to select values, JSONPath is simpler and is now standardized as RFC 9535.

Why does my query work in another tool but not here?

JSONPath was informal for roughly 17 years, so libraries disagree on details such as whether a filter needs parentheses (?(@.price<10) versus ?@.price<10), how to handle missing keys and what $.. includes. This tester follows RFC 9535 by default (which accepts a filter with or without parentheses) and offers an extensions dialect for the common older operators. Script expressions that run code, like (@.length-1), are not supported in either mode.

What do $, @ and .. mean?

$ is the root of the document and @ is the item currently being tested inside a filter. Two dots (..) mean “search at any depth”, so $..price finds every price anywhere in the document.

Can I use it for NDJSON or JSON Lines files?

Yes. Drop the file or paste the lines; the format is detected automatically and each line is treated as one record. You can also force NDJSON mode in the sidebar.

Why are big numbers shown differently in comparisons?

JavaScript cannot represent integers above 9,007,199,254,740,991 exactly. The tester warns when your document contains such numbers. Comparisons in filters use the rounded value, but anything you copy or export keeps the digits exactly as written in your source.

How do I get the path of a value I can see?

Open the Tree explorer below the editor and click the value. Its normalized path becomes the query. You can also click any value in the source text that a query already matches and copy its path from the result card.

Privacy

Everything on this page runs in your browser. Parsing, querying, highlighting, the tree, exports and code snippets are all local, and no library is downloaded at all, so it keeps working offline after the first visit.

Your JSON is saved in your own browser (IndexedDB) so it is still there after a refresh. It never goes to a server. The Clear saved JSON button deletes it in one click, and your last query settings, history and saved queries are kept in local storage on your device.

There is one optional feature that uses the internet: Load from a URL. It is off by default, sits behind an unchecked box that states “This step is not local-only: it needs the internet to fetch the URL you enter. Nothing else leaves your browser”, and does nothing until you tick it. It sends a plain request to the address you typed, without cookies or custom headers, and the response is read in your browser. Many sites block such requests from other websites (CORS); if that happens, open the URL in a tab and paste the JSON instead.

Limitations

  • No script expressions that execute code (for example (@.length-1)). Use length() in a filter or a negative index such as [-1] instead.
  • Regular expressions in match() and search() run on your browser’s regex engine with the standard’s rule that . does not match line breaks. Exotic features outside the I-Regexp standard may behave differently from other implementations.
  • Queries are stopped after two million node visits, and results are capped at 200,000 matches, so a very broad .. query on a huge document gets a clear message rather than freezing the page.
  • Code snippets are starting points; other libraries may not support every feature shown here.