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 plain text diff tools that compare 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 performs a recursive deep diff on your two JSON inputs and renders the result with color coding: green for added keys, red for removed keys, and yellow for changed values. The diff is displayed as formatted JSON so the context remains readable.

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. Click Sample to load a demo pair. Both inputs must be valid JSON.

2

Instant diff output

The diff result appears automatically. Keys added in the right document are highlighted green, keys removed from the right document are highlighted red, and keys whose values changed are highlighted yellow.

3

Copy or review the diff

Click Copy Diff to copy the diff summary to your clipboard. Scroll through the output to inspect every change.

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?

Arrays are compared element-by-element by index. If an element is added at the end, it is marked as added. If an element at a given index has a different value, it is marked as changed. Array elements are not matched by value — only by position.

Can I diff deeply nested JSON?

Yes. The diff engine recurses through all nested objects and arrays regardless of depth. Each nested change is reported at its exact path.

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.