JSONata Tester & Transformer

Run JSONata queries and transformations locally. Test bindings, grouping, functions and object updates; copy or download the complete JSON result.

Query and reshape JSON

Enter strict JSON, write a JSONata expression and select Evaluate. Paths select values; predicates filter them; object and array constructors create a new output shape. The Example calculates two order-line totals with a tax multiplier supplied in Bindings. It returns a customer, line items and a total of 54. All three editors are independent; changing one clears the previous result.

Bindings and reusable expressions

Bindings are an optional JSON object. For {"tax": 1.08}, reference $tax in the expression. Names omit the leading $ and must parse as JSONata variable names. Values can be JSON objects, arrays, strings, numbers, booleans or null; the page does not accept JavaScript functions or register HTTP/file extensions. A binding with a built-in function's name replaces that name for the evaluation, so binding sum to a number makes $sum(...) a type error.

Aggregation, functions and transforms

Use $sum(orders.(price * quantity)) for aggregation, $map and $reduce for higher-order operations, and grouping or joins to combine records. For example, $ ~> |orders|{"total": price * quantity}| returns a copy with a total added to each order. JSONata's $eval evaluates another JSONata expression, not JavaScript. Ordinary functions, regexes, sorting and transforms use the pinned reference engine; JSONPath and JMESPath syntax are separate languages. Base64 functions use Web btoa/atob with ASCII/Latin-1 binary strings. For Unicode text encoded as UTF-8, use the Base64 tool.

No result, null and arrays

A missing path can produce an empty sequence, shown as No result (undefined), with Copy and Download disabled. A JSON null remains null; false, zero and an empty string are also valid defined results. JSONata can flatten a path sequence or return a singleton as a scalar. Construct an array explicitly when its shape matters. Function-valued results cannot be exported as JSON; call the function or return a JSON structure.

Errors and numeric precision

Syntax and runtime failures display the engine's code and available position in Details. The engine message is limited to 512 characters and rendered as text. JSON input and bindings reject duplicate keys, malformed Unicode, non-finite numbers and integers outside JavaScript's safe range; numeric expression literals and exported integers have the same safe-integer check. Arithmetic still uses binary64 and can round intermediate values. Use decimal strings or a dedicated exact-decimal workflow when exact decimal arithmetic is required.

Local evaluation and practical limits

The bundled JSONata 2.2.2 engine runs in a disposable browser Worker. Inputs are not uploaded or saved to localStorage, and the page does not share expressions automatically. Input is limited to 1 MiB, bindings to 64 KiB and 100 names, and expressions to 16 KiB. JSON structures allow 64 levels and 20,000 visited values; expression ASTs allow 128 levels and 20,000 values. The engine uses a 256-level stack budget, a 2-second evaluator budget and 20,000-item sequences. A separate 5-second Worker deadline covers parsing and native regex work. These limits do not establish a fixed browser-memory quota. The same AST and expression-size checks apply to programs passed to $eval.

Complete JSON exports

Choose pretty or compact JSON. The textarea previews at most 200,000 characters; Copy and Download use the complete permitted result, capped at 2 MiB of UTF-8 JSON. Cancel, editor changes and file selection discard in-flight work. UTF-8 files may contain a BOM. A file replaces only Input JSON; the expression and bindings remain available.

FAQ

Does JSONata run JavaScript?

Expressions use the JSONata language. The page does not expose JavaScript evaluation, host functions, HTTP requests or filesystem access.

Why is a missing path different from null?

JSONata can return an empty sequence, represented internally as undefined. Null is a defined JSON value and remains exportable.

Can I use JSONPath or JMESPath expressions here?

Use the corresponding related tool for those languages. This page runs JSONata 2.2.2 with its own functions, grouping and transform operators.

Other Languages

JSONata Tester & Transformer — Base64.sh

JSONata Tester & Transformer

Run JSONata queries and transformations locally. Test bindings, grouping, functions and object updates; copy or download the complete JSON result.

Share:

References

How we make sure

We check this tool with the automated test suites linked below. Example checks are shown in their original language.

Verification method
Check query/transformation results for fixed JSON fixtures, errors and boundary limits.
Comparison reference
Explicit JSONata expected results and library integration, without a second expression-engine comparison.
Verification scope
These samples and boundaries do not prove correctness for every input.
Test source and cases (select a file to read it)
  • jsonata-tools.test.js
    • JSONata invoice sample uses actual bindings, mapping, rounding and independently calculated totals
    • JSONata empty sequence differs from null, false, zero and an empty JSON string

These checks cover the listed examples and boundaries, not every possible input. Round trips and checks using the same library are not independent verification.