JSON Diff Tool

Compare API responses by array index or record ID, ignore volatile fields, and export the changes with their JSONPaths.

Added

0

Removed

0

Changed

1

Original JSON

Changed JSON

Use a unique string or safe integer field in every object array, including nested arrays. Primitive arrays still compare by index.

Use slash paths such as /generatedAt. A * segment matches one property or array index. Use ~1 for / and ~0 for ~ in property names.

Large integer IDs must be quoted strings. Decimal values use JavaScript number precision. The sample ignores timestamps and matches users by id.

Structured differences

Download

Comparison complete

Found 1 difference under the selected comparison rules. Ignored 3 matching fields.

0 added 0 removed 1 changed 3 unchanged
$.users[0].name changed

Original path: $.users[1].name · Changed path: $.users[0].name

Before

Grace

After

Grace Hopper

Try a worked example

All JSON tools and guides

Compare Two JSON Documents

The JSON Diff Tool parses two documents and compares their actual data structures. It reports added properties or array items, removed values, changed values, and unchanged branches. Each result includes a JSONPath so the difference can be located in the original documents.

Unlike a line-based text comparison, whitespace and object property order do not create false differences. Array index mode preserves order. Record ID mode matches object-array records by a unique field, so reordered records do not create changes. Primitive arrays always compare by index.

Compare API records and ignore volatile fields

Use Record ID mode with a unique string or safe integer field such as id. Enter ignored paths one per line, for example /generatedAt and /users/*/updatedAt. A * segment matches one property or array index. Duplicate IDs produce an error instead of an ambiguous result.

Follow the worked examples for comparing JSON arrays by ID and ignoring API timestamps.

Large integer IDs must be quoted strings; decimal values use JavaScript number precision. Reports contain up to 1,000 rows and explicitly mark partial results. A partial report does not establish equality.

JSON Diff Use Cases

  • Compare API responses from two environments or releases.
  • Review changes between configuration snapshots.
  • Check expected and actual test fixture output.
  • Find altered values in webhook or event payloads.

Enable unchanged rows when you need context around the differences. The exported diff contains the comparison rules, a summary, ignored-field count and change entries, making it easier to share a focused result. The report still contains the before and after values of changed entries, including whole added or removed objects.

Format malformed input with the JSON Formatter before comparing it. Use the JSONPath Tester to query a path discovered in the diff.

Frequently Asked Questions

How does the JSON diff tool compare documents?
It compares parsed object properties, primitive values and arrays. Arrays can compare by index or match records by a unique ID field.
Does JSON key order affect the result?
Object key order does not matter. Array order matters in index mode; record ID mode ignores record order when matching object arrays.
Can I compare sensitive JSON locally?
Yes. Both documents are parsed and compared locally in your browser.

Related Tools