JMESPath online evaluator

Extract and transform JSON data using JMESPath expressions in an online editor and view the results in real-time

Uses JMESPath syntax for JSON data transformation and extraction. Examples: people[*].name or people[?age > `25`].name

About this tool

This online tool allows you to extract and transform values from JSON data using JMESPath expressions. The extracted content is updated in real time as you type your expression.

This playground uses the same logic as the Mockoon features that support JMESPath syntaxes like the jmesPath helper.

About JMESPath

JMESPath is a query language for JSON data. It allows you to declaratively specify how to extract elements from a JSON document. JMESPath has built-in functions and powerful features for filtering, transforming, and projecting data.

Basic syntax

JMESPath expressions consist of keys, array indices, and functions. Here are some basic examples:

ExpressionDescription
keyAccess object key
key.subkeyAccess nested object
array[0]Access array element by index
array[*]Wildcard - all array elements
array[*].keyProject - extract key from all array elements
array[?condition]Filter array elements
array[:2]Array slice - first 2 elements
array[-1]Last element of array

JMESPath examples

Copy
{ "people": [ { "name": "John", "age": 30, "city": "New York", "skills": ["JavaScript", "Python", "React"] }, { "name": "Jane", "age": 25, "city": "San Francisco", "skills": ["Java", "Spring", "Docker"] }, { "name": "Bob", "age": 35, "city": "Seattle", "skills": ["C#", ".NET", "Azure"] } ], "company": { "name": "Tech Corp", "founded": 2010, "locations": ["US", "UK", "Germany"] } }
JMESPath ExpressionResult
people[*].nameAll names from people array
people[0].nameName of first person
people[?age > `25`].nameNames of people older than 25
people[?city == 'New York']People living in New York
people[*].skills[0]First skill of each person
people[*].skills[]All skills from all people (flattened)
company.nameCompany name
company.locations[*]All company locations
length(people)Number of people
max(people[*].age)Maximum age
sort_by(people, &age)People sorted by age

Built-in functions

JMESPath provides many built-in functions for data manipulation:

  • Array functions: length(), sort(), sort_by(), reverse(), join()
  • Math functions: min(), max(), sum(), avg()
  • String functions: starts_with(), ends_with(), contains()
  • Type functions: type(), keys(), values()

Comparison operators

OperatorDescription
==Equal to
!=Not equal to
<Less than
<=Less than or equal to
>Greater than
>=Greater than or equal to