JSON Diff
Compare two JSON documents side by side and highlight added, removed, and changed values. Structural comparison — runs entirely in your browser, no data is sent to any server.
Frequently Asked Questions
{"a":1,"b":2} and {"b":2,"a":1} are treated as identical.add, remove, replace, move, copy, test) that transforms one JSON document into another. A JSON diff is the process of computing those differences; JSON Patch is a machine-readable way to serialise and apply them. Libraries like fast-json-patch (JS) and jsonpatch (Python) can generate and apply RFC 6902 patches programmatically.git diff or Unix diff) compares raw characters line by line. It will flag a change if you simply reformat or reorder keys, even when the data is logically identical. A structural diff parses both sides first, then compares the in-memory data trees — so reformatting, reindenting, or reordering object keys produces zero differences. For JSON, structural diffing is almost always more useful because it reflects actual data changes rather than cosmetic edits.About This JSON Diff Tool
This free JSON diff tool compares two JSON documents and highlights exactly what changed between them. Unlike a plain text diff, it parses both sides into their underlying data structures first, so differences in formatting, indentation, and key order are ignored — only real changes to keys and values are reported.
Comparing JSON is a routine task when reviewing API responses across versions, validating configuration changes, debugging data syncs, or auditing what an edit actually modified. A side-by-side structural diff makes those changes obvious at a glance.
When to use this tool
- Spotting what changed between two API responses
- Reviewing config file edits before deploying
- Auditing the result of a data migration or transform
- Comparing expected vs. actual output in tests
How JSON Diffing Works
Three steps run every time you click Compare:
Parse
Each side is parsed with JSON.parse(). If either fails, a clear error tells you which input is invalid and why.
Walk
Both structures are walked recursively. Objects are matched by key (order-independent); arrays are matched by index. Each node is classified as unchanged, added, removed, or changed.
Render
The result is laid out as aligned side-by-side rows with red, green, and amber highlights, plus a summary count of each change type.
Common Use Cases
API Version Comparison
Compare the same endpoint's response across two API versions to see which fields were added, removed, or renamed before upgrading a client.
Config Change Review
Diff before and after versions of a JSON config to confirm an edit changed only what you intended.
Test Assertions
Compare expected vs. actual JSON when a test fails, to pinpoint the exact field causing the mismatch.
Data Migration Audits
Verify that a transform or migration preserved the right data by diffing a sample record before and after.
Related Developer Tools
Related Articles
View all articles
Why Two Identical JSON Objects Look Different in a Diff — Normalization, Canonical Form, and the Array Problem
Two JSON objects with identical data can fail equality checks because of different key ordering — a false difference that corrupts any text-level diff. Here's the three normalization problems (key ordering, formatting, numeric representation), RFC 8785 canonical JSON for digital signatures, the practical parse-sort-serialize workflow for normalization before diffing, and why arrays create a harder normalization problem with no universal solution.
JSON Structural Diff Fundamentals: Why Key Order Doesn't Matter, Null Isn't "Missing," and Arrays Can Cascade
{"a":1,"b":2} and {"b":2,"a":1} represent identical data per the JSON spec — but a text-based diff would show them as completely different. Here's how structural diffing handles key-order (unordered per spec), numeric representation differences (1 vs 1.0), the genuine structural difference between null and a missing key, and why array reordering can cascade into multiple "changes" under positional comparison.
Snapshot Testing Is Just JSON Diffing With Extra Steps — Here's Why That Explains Both Its Strengths and Its Noise
Snapshot testing is, underneath, just "save a JSON diff result and fail the test if it's not empty next time" — and seeing it this way explains both why snapshot tests catch bugs that assertion-based tests miss, and why they're notorious for generating noisy, rubber-stamped diffs. Here's how the snapshot-compare-update cycle works, why "everything changed" diffs from one intentional change lead to rubber-stamping, and why a genuine bug can hide among repetitive, expected diff entries.
JSON Patch and JSON Pointer: How "What Changed" Becomes a Standardized, Executable Sequence of Operations
"What's different between these two JSON documents" and "what's the smallest sequence of operations that transforms one into the other" are related but distinct questions — the second is what JSON Patch (RFC 6902) standardizes. Here's the six JSON Patch operations, the JSON Pointer path syntax they rely on, how the test operation enables optimistic concurrency control, and when the simpler JSON Merge Patch is sufficient instead.
Practical JSON Diff Workflows: Debugging APIs, Finding Config Drift, and Verifying Migrations
The most common reason to reach for a JSON diff tool is "something changed and I need to know exactly what, fast." Here's four practical workflows: diagnosing API response changes, finding configuration drift between environments, verifying data migrations changed only what was intended, and triaging failing test assertions where the actual difference is buried in a large JSON structure.