Cookies This site keeps only what it needs to work. There is no analytics and no advertising on it today, and nothing here follows you to other sites. Read the privacy policy

Choose what to allow
+92 312 8299940Free Quote
EN – Language: English
Free tool, nothing to install

JSONPath Tester Online
Run A Path, See Every Match

The online JSONPath testing tool will apply your given JSONPath to your input JSON data and return each matching element along with its location. The testing tool supports the use of filters, slices, and wildcards, directly from within the browser.

  • FreePrice
  • 8Selectors
  • NoneSign-up
  • NoneUploads

JSONPath Tester

Type a path, see every match and the exact path to it

Ready. Paste JSON, type a path and the matches appear.

Your browser does all of the work here, in this tab. We upload nothing, store nothing and log nothing.

An automatic check, not a final verdict

This tool reads your code as text. It cannot run every script or test every browser, so review each finding before you delete or rewrite anything.

Add a link to this tool on your own site

Copy the code below and drop it into your page. It places a link to this free tool.

The short version

What A JSONPath Tester Online Is For

JSONPath is a simple tool to select data from JSON. It is like XPath, but created just for JSON. A single line can extract all the prices from a large response.

This JSONPath tester online lets you try a path before you put it in code. Paste your JSON, type the path, and the matches appear as you type. Each match shows its own full path, too.

That helps in a great many ways. JSONPath can be used by API testing tools, test suites, searching logs, and even in no-code applications. If you give a bad JSONPath then you won’t get any results back from it. No results look like success, so doing the testing before using the JSONPath will save time.

The engine was developed from scratch, so it will never interpret your text as program instructions. The engine was designed based on RFC 9535; but, it also understands the older format that many people use today.

JSONPath can also help in debugging. For example, if your test failed due to a missing field, paste the response into the tool, execute a JSONPath query, and quickly work out whether the field is present, and if so, what its location is. This will enable you to confidently update your test.

Your First Path

Every path starts with a dollar sign. The dollar sign represents the top level of the entire document. Following the dollar sign you will include steps. A period followed by a word will select a child. For example, $.store.bicycle.color goes from the top level of the store down to the color of the bicycle.

Drawing of a JSON document and a dollar-sign JSONPath with arrows picking out three values
A path picks values out of a document.

Square brackets do the same job and also allow names with spaces or dots. Write $["my key"] for those. Numbers in brackets pick a list item, starting at zero.

To test a sample, press Try a sample and select one of the sample chips. The tool will then populate your selected path with data, and run it.

Wildcards And Searching Everywhere

A star means every child. $.store.book[*].author gives the author of every book. The same star works after a dot, as in $.store.*.

JSONPath tester running the path dollar dot dot price and listing five matches, each with its own full path
Two dots search the whole document.

Two dots represent an unconstrained search. For example, $..price will return all of the prices within the entire document, regardless of whether they are associated with a book or a bike. This is the fastest way to locate a specific value when you have no idea what location it may be found.

The matching results will be returned in the exact same sequence as they are listed in the document. Every match displays the exact location (or path) of each item, making it possible for you to copy the location and use it as a very specific address.

Also remember that results keep their order. If a list holds ten items, the matches come back in the same order. So you can pair them with another list safely.

Slices, Unions and Negative Index Values

Several items can be picked at the same time. [0,2] takes the first and the third. [1:3] makes a slice. It picks up items from index 1 to just before index 3, right here.

JSONPath tester running a slice that returns the last book in the list, with the matching path shown below it
A negative slice returns the last item.

Slices may take a step. [::2] picks every other element. A negative number will be indexed from the last element (i.e., [-1] would refer to the last element), and [-2:] refers to the last two elements.

JSONPath Filter Online

Filters are where the real strength lies. They keep only the children that pass a test. $.store.book[?(@.price < 10)] keeps books cheaper than ten. The at sign stands for the item being tested.

JSONPath tester running a filter for books under ten dollars and listing two matching titles with their paths
A filter keeps only the items that make it through.

You can combine your tests with and, or, and not. If you want to check if a specific key exists, you just need to put it on its own, like this [?(@.isbn)]. You can compare different types of data (e.g., number, text, boolean, null) in your tests.

Need to match text? Use a regular expression with =~, as in [?(@.author =~ /^e/i)]. Or call a function such as length(@.title) or count(@.*).

Clear Messages When A Path Is Wrong

A typo should not leave you guessing. When the path is invalid, the tool says what is wrong and puts a caret under the exact spot. A missing bracket, a bad regular expression and an unknown function each get their own sentence.

JSONPath tester showing an error for a path with a missing closing bracket and a caret pointing at the problem
The caret points at the mistake.

Three Ways To Write The Same JSONPath

The address for every match will be displayed. You can choose how you would like to display your path (brackets, dots, or JavaScript) by changing Show paths as. If you select JavaScript, such as data.store.book[0].title, this will allow you to copy and paste directly into your code.

Video guide

How the JSONPath Tester Works, Step by Step

This brief video shows each step from start to finish. Choose your language below, and switch on captions if they help.

How it works

Using The JSONPath Tester, Step By Step

Four steps take you from raw JSON to a path you trust.

  • Paste your JSON

    You may use the copy and paste feature, create a new document, or open the sample Bookstore document. Your path will be verified as you type.

  • Type a path

    A JSONPath expression will always begin with the ’$’, representing the root. If you would like to have a better understanding, please click on one of the chips.

  • Read the matches

    The value of every match and the way in which it is approached can be seen. The number of matches that have been located on a particular path is shown by the counter.

  • Copy what you need

    Copy the values as a JSON list, or the paths, one per line.

Why this one

What This JSONPath Tester Does Differently

Plenty of testers return a value and stop. These are the extras.

  • Each match shows its own path

    You can copy each hit’s full address (in either brackets, dots, or JavaScript) from the search results.

  • Real filters

    Use and, or, not, comparisons, regular expressions and functions inside a filter.

  • Helpful errors

    A caret points at the mistake, and a plain sentence says what to change.

  • Exact numbers

    Long ids keep every digit, so a match never shows a rounded number.

  • Built-in cheat sheet

    A short table of the syntax sits under the tool, so you never leave the page.

  • Nothing leaves your tab

    Your real API data may contain private info. But, since the work is completed by your browser, no private data will reach our website.

Good habits

Habits For Writing Reliable Paths

A path that works on one sample can break on the next. These habits help.

  • Begin with the shortest path that could possibly reach your data. Then add one step at a time and watch the match count change. When a path breaks, you know which step did it.
  • Use two dots sparingly. Searching in depth is helpful. But, it can find fields that were not intended to be selected. So, when possible, use a well-defined search route.
  • Test with real data. Paste a true response, not a tidy example. Real data has missing keys and odd values.
  • Check the empty case. What does the path return if no matches occur? You need to make sure your program can deal with an empty list.
  • Test that a key exists before you compare it. If a filter is applied to a missing key, it will simply remove the item. If you want to find out why, use an existence check.
  • Quote names that have special characters. A name that has a dot or a space must have brackets and quotes, for example ["my key"].
  • Mind the type in a comparison. To JSONPath, the number 5 and the text "5" are two different things. A filter that compares them says no.
  • Know your library. Libraries may differ slightly on how they use syntax. Use this area to test, then review the documentation of your library to work out what is different.
  • Use the exact path for updates. To change one value, use the full path from the list, not a search. That avoids touching the wrong one.
  • Save your best paths. Keep a short list of them in your notes. A good path is worth reusing.
Worth avoiding

Common JSONPath Mistakes This Tester Catches

Each of these returns nothing or the wrong thing. The tester shows it at once.

  • Forgetting the dollar sign

    Every single JSONPath expression must begin with $. When you use the tester, it will inform you about this requirement rather than producing an empty array.

  • A missing bracket

    If there is an opening bracket but no closing bracket, the entire path is broken. The cursor location will indicate the end of the path.

  • Counting from one

    Lists begin with an index of zero; so, the element [1] is considered to be the second element, not the first.

  • Comparing the wrong type

    A price stored as text will not be verified by a number check. Review the results to work out what value was entered.

  • Using script brackets

    This tool blocks old-style syntax (e.g. [(@.length-1)]) because it runs code, and that can be unsafe. You should use a negative index instead.

  • Matching too much with two dots

    The result of a thorough search may locate similar looking keys elsewhere. Review the route taken by every hit.

Questions

JSONPath Tester Questions People Ask

Is this JSONPath tester online free?

Yes. You pay nothing, you need no account, and there’s no cap. Your browser does the heavy lifting, so we have no server bill to recover from you.

Is the JSON I test sent to a server?

No. Your browser uses the path. Nothing connects to this website and we do not store anything. Close the tab, and there will be no evidence that you ever visited it.

What is JSONPath?

JSON queries are a method of querying JSON data. They allow you to select value based on either name, position, or conditional statements. They operate similarly to XPath in selecting values from XML documents.

Does it follow RFC 9535?

The shape of the standard is used for this, with filters, slices and functions. Many libraries use the older Goessner style, so it is compatible as well.

What do the two dots in a JSONPath mean?

The "$" in <code>$..name</code> means to search for a name key at all levels of depth, regardless of how deep the key is located.

How do I filter matches by a value?

Put a filter inside brackets. For example, <code>[?(@.price > 10)]</code> keeps the items with a price above ten. The at sign stands for the item.

Can a JSONPath filter use regular expressions?

Yes. Write <code>=~</code> and a pattern between slashes, such as <code>[?(@.name =~ /^a/i)]</code>. Add the i flag at the end when upper and lower case should match alike.

Why does it say script expressions are not supported?

Old syntax using round brackets within square brackets is evaluating code. This is why we are rejecting it and as such no code will be executed. The same result can be achieved through either a filter or a negative index.

Why does my path return nothing?

Check the spelling, the capitalization (case), and the parentheses (brackets). Check the type used within a filter. Start with <code>$</code> and add each step as you go along.

Can I use the path in my code?

Yes. Most libraries accept the same syntax. Test here, then paste the path into your code. If a library differs, the cheat sheet shows what to adjust.

What does the tester do if one key shows up twice in the same object?

The first one wins when you pick by name. A deep search can still reach both, because it visits every entry.

Do large numbers appear exactly?

Yes. The reader keeps every digit, so a 20-digit id appears as you wrote it.

Does it run on phones too, or only on desktops?

Yes. Both of the panels can be stacked, and the example chips are wrapped. While for short editing periods, a keyboard is certainly easier.

More free tools

Handy Companions For JSON Work

Testing a path is one step. These three tools handle the steps around it.

  • JSON Viewer

    Read JSON as a tree or a table, then edit it.

  • JSON Formatter

    Beautify, minify and validate, and see the exact line where any error sits.

  • JSON Diff

    Compare two JSON documents by meaning, and list every change.

Ready To Test A Path?

Your JSON can be pasted into the tester. You can then enter a JSONPath and see the results. The tester does not need an account, is free, and stores all of your data locally.

Prefer Denwix on GoogleReview Denwix on Google