Original JSON (Left)

Modified JSON (Right)

What Is a JSON Diff Tool?

A JSON diff tool compares two JSON documents and shows the structural differences between them. Unlike an online text comparison tool that diffs line-by-line, a JSON-aware diff understands the data structure — it recognizes when a key is added, removed, or its value changed, regardless of whitespace or key ordering.

This tool walks both documents recursively and lists every difference as a line with its full path: status: "pending" → "shipped", items[0].qty: 2 → 3, + trackingNumber. Lines are marked + (green) for keys added on the right, − (red) for keys removed, and ~ (yellow) for changed values, with a count of each at the top. Big integers are compared digit for digit, so two 19-digit IDs that differ only in the last digit show up as a change. If you need a machine-readable change description instead, look at JSON Patch (RFC 6902), which expresses additions, removals and replacements using JSON Pointer (RFC 6901) paths.

How to Compare Two JSON Documents

Follow these steps to diff your JSON documents.

1

Paste your two JSON documents

Paste the original JSON in the left panel and the modified JSON in the right panel, or click Sample to load two versions of order ORD-7421. Both inputs must be valid JSON.

2

Click Compare

Click the green Compare button. The diff appears below the editors: keys added in the right document in green, keys removed from it in red, and changed values in yellow, each with its path. If both documents are the same, you get a "no differences" message instead.

3

Copy or review the diff

Click the copy button next to Compare to copy the diff as plain text, one line per path, prefixed with +, - or ~. Handy for pasting into a pull request or ticket.

Common Use Cases

API Response Regression Testing

Capture the JSON response before and after a code change, then diff them to verify that only the expected fields changed — a fast and visual regression check.

Configuration Change Review

Before deploying a new application configuration, diff the old and new JSON configs to confirm no unintended changes slipped through the review process.

Database Snapshot Comparison

Compare two JSON exports of the same database record to audit what changed between versions — useful for audit trails and debugging data corruption.

Schema Version Migration

When migrating a JSON Schema from v1 to v2, diff the two schema files to produce a clear change log that documents every added, removed, or modified field.

Frequently Asked Questions

Does the diff consider key order?

No. The diff is key-based, not position-based. If the same keys are present in both documents with the same values but in a different order, the documents are considered identical. This mirrors how RFC 8259 defines JSON objects as unordered collections.

How are arrays compared?

Element by element, by index. If the right array is longer, the extra elements are marked as added; if it's shorter, the missing ones are removed. Elements at the same index are compared recursively. Elements aren't matched by value, so inserting one item at the start of a list makes every later index look changed. Sort both arrays the same way first if order doesn't matter to you.

Can I diff deeply nested JSON?

Yes. The diff recurses through nested objects and arrays at any depth, and each change is reported at its full path, for example shipping.method or items[0].qty.

Is my JSON sent to a server?

No. All diff computation happens entirely in your browser. Neither JSON document is transmitted to any server.

What if one document is a subset of the other?

Keys present in the right document but not in the left are marked as added. Keys present in the left but not in the right are marked as removed. The diff clearly distinguishes additions from deletions.

Related Tools

Explore more JSON comparison and validation tools on jsonparser.ai.