JSON Diff Viewer
100% LocalCompare two JSON objects and highlight semantic differences.
Paste two JSON objects side by side. Added, removed, and changed fields highlight with color coding.
Learn More
Configuration Mastery: Taming the YAML vs. JSON vs. TOML War
We Benchmarked 6 JavaScript JSON Parsing Approaches: What Actually Wins in Practice
A realistic comparison of JSON.parse, streaming parsers, bigint-safe parsers, and WASM-based JSON libraries for normalized performance and memory trade-offs.
JSON Schema Validation: Stop Trusting API Responses Blindly
What is JSON Diff Viewer?
Frequently Asked Questions
Technical Deep Dive
JSON Diff Viewer
Paste two JSON documents and see a semantic diff showing added, removed, and changed properties with their paths. Handles nested objects and arrays. Copy a structured diff report for documentation.
Text diffs lie about JSON: key order and whitespace look like changes. This diff compares parsed structures so only real field deltas show.
Left {"id":1,"ok":true} vs right {"ok":true,"id":1} should be empty. Change ok to false and you get one field.
It will not tell you why an API started omitting a key. Pair it with the formatter when the paste is minified.
01 Difference Logic Matrix
| Change Type | Definition | Visual Treatment | Semantic Impact |
|---|---|---|---|
| Added | Key exists in Right but not Left | Green Highlight | New metadata or resource field |
| Removed | Key exists in Left but not Right | Red Highlight | Deprecated or missing data |
| Modified | Values differ for the same key | Amber Highlight | Data update or state transition |
| Reordered | Same keys in different sequence | Ignored | No semantic difference (Spec-compliant) |
02 Comparison Pipeline Workflow
03 When a Structural JSON Diff Is the Right Tool
Most diff tooling assumes line-oriented text. JSON is a tree, and once you treat it as one, several review and debugging tasks become dramatically faster. These are the cases that justify reaching for a structural diff instead of git diff or diff -u.
-
Staging vs production API responses Hit the same endpoint on two environments, paste both bodies side by side, and you see schema drift instantly: a field renamed, a nested array reshaped, a nullable that suddenly returns
undefined. Line diffs lose the signal in re-ordered keys. -
package-lock.json change review A "small" lockfile bump usually touches 200 lines but only a handful of resolved versions actually moved. A structural diff filters out the alphabetical reordering and surfaces the actual dependency changes (resolved URL, integrity hash, transitive promotions).
-
Config drift detection Two clusters of the same service, two slightly different configs. A semantic diff of the rendered config JSON tells you exactly which feature flag, timeout, or endpoint URL drifted, without making you read indentation.
-
A/B variant payload analysis Variant A returns one JSON shape, Variant B another. Diff the two responses to confirm that the only differences are the intended ones, and not, say, an unrelated experiment leaking a new analytics field into both arms.
-
RFC 6902 / RFC 7396 patch authoring When you need to produce a JSON Patch (RFC 6902 add/remove/replace ops) or a JSON Merge Patch (RFC 7396), a structural diff is the natural starting point, every changed path becomes a patch operation.
04 Worked Examples
{"id":"42","status":"paid","total":1299,"customer":{"id":"c_1","email":"a@x.io"}}
{"id":"42","status":"fulfilled","total":1299,"customer":{"id":"c_1","email":"a@x.io","tier":"gold"},"shippedAt":"2026-05-20T10:00:00Z"}
~ status: "paid" → "fulfilled"- customer.tier: "gold"
shippedAt: "2026-05-20T10:00:00Z"
Three real changes surface immediately. A textual diff would have flagged the entire customer object as changed simply because new fields shifted positions.
{"tags":["alpha","beta","gamma"]}{"tags":["beta","alpha","gamma"]}~ tags[0]: "alpha" → "beta"
~ tags[1]: "beta" → "alpha"
Index-based matching aligns with RFC 6902 semantics, arrays are sequences, not sets. For set-like data (permissions, tags), switch to content-based matching to report no change. Choosing the right mode is a domain decision, not a tool default.
{"email":"a@x.io","phone":null}{"email":"a@x.io"}- phone: null // key removedRFC 7396 treats null as the removal sentinel in merge patches, which is the opposite of how RFC 6902 ("remove" op vs "replace with null") treats it. The diff distinguishes "key absent" from "key present, value null", a distinction that bites every API team that conflates the two.
05 Related Tools
Diffing JSON is usually a step in a larger workflow, formatting, schema validation, or patch generation. Pair this tool with the rest of the JSON toolchain.
JSON Formatter
Normalize both sides to a canonical pretty form before pasting, useful when one input is minified and the other is pretty-printed.
Text Diff
For non-JSON payloads, configs, or logs, drop down to a line-based diff. Helpful when comparing rendered templates rather than their JSON source.
OpenAPI Validator
After spotting a payload change in the diff, validate both sides against the published OpenAPI spec to confirm which side is the contract violator.