JSONata Tester (Playground)
Evaluate JSONata expressions against your JSON and see the output as you type. JSONata is a lightweight query-and-transformation language for JSON — think XPath for JSON, but with arithmetic, string and aggregation functions, and the power to build entirely new structures. Paste your data, write an expression, and the result appears live. It all runs locally with the official JSONata engine, so nothing is uploaded.
How to use the JSONata Tester (Playground)
Paste your JSON into the input box and write a JSONata expression in the field at the top. The result is evaluated automatically a moment after you stop typing and shown as pretty-printed JSON. Because JSONata is an expression language, the whole query is a single expression — the default example builds a new object with a computed total and an item $count.
Try navigation like order.name (which returns all names), predicates like order[price > 5], aggregation with $sum, $average, $max, and $count, string functions such as $uppercase and $join, and object construction with {...} to reshape the data. The $ at the start of a function name distinguishes built-ins from your field names.
What is JSONata
JSONata is a query and transformation language for JSON, inspired by the location-path semantics of XPath but extended into a full functional expression language. A single JSONata expression can navigate a document, filter it, aggregate values, perform arithmetic and string manipulation, and emit a brand-new JSON structure — which makes it popular for low-code integration platforms, API gateways, and tools like Node-RED where data has to be reshaped between systems.
Navigation looks like dotted paths: order.price returns the price of every order as a sequence. Square brackets act as predicates rather than indexes by default, so order[qty > 1] keeps matching items, while order[0] selects by position. Sequences flatten automatically, which is why mapping over an array needs no explicit loop. The result of one step feeds into the next, so paths compose naturally.
What sets JSONata apart is its function library and constructor syntax. There are built-ins for numbers ($sum, $average, $round), strings ($substring, $replace, $split, $join), arrays ($count, $sort, $map, $filter, $reduce), and aggregation. Object ({ }) and array ([ ]) constructors let you assemble new output, and you can define your own functions with function($x){...}. The result is that one expression can replace a sizeable chunk of imperative transformation code.
Common use cases
- Reshaping JSON. Transform an API response into the exact structure a downstream system expects.
- Aggregating data. Compute totals, averages, counts, and grouped summaries in one expression.
- Low-code integration. Prototype and debug the JSONata mappings used in Node-RED, IBM App Connect, and similar platforms.
- Filtering and querying. Extract just the records that match a predicate without writing a script.