JSON Diff
Structural diff for two JSON documents — keys added, removed, changed, and value changes shown side by side.
Enter input above to see the result.
What is this for?
A plain-text diff on JSON tells you which lines changed; a structural diff tells you which data points changed. They're often very different — a reformatted document with no semantic change is "every line different" to a text diff but "no changes" here. This tool walks both JSON trees and reports each path where they differ, using RFC 6901 JSON Pointer syntax (/users/0/name) so the output is unambiguous regardless of formatting or key ordering.
When to use it
- Comparing two API responses to see what actually changed in a release, ignoring whitespace and key-order noise.
- Diffing configuration files before and after a migration to confirm only the intended fields were modified.
- Generating an RFC 6902 JSON Patch document to ship to a system that supports it — useful for PATCH endpoints or JSON-Merge-Patch fallbacks.
- Eyeballing two test fixtures to understand what makes one pass when the other fails.
- Auditing data transformations in ETL pipelines to verify no unexpected fields were added or dropped.
- Reviewing schema migrations or data exports to spot unintended structural drift.
How it works
- Paste or upload two JSON documents. The tool accepts minified or formatted JSON; both are normalised before comparison.
- Choose an array comparison mode. "By index" reports insertions as a cascade of removals and additions downstream. "By value" treats arrays as unordered sets and ignores reorderings. Pick the mode that matches your data semantics.
- The tool traverses both trees in parallel, tracking the path to each key-value pair using JSON Pointer notation. Any deviation — a missing key, a different value, a type change — is recorded with its full path.
- Results are shown side by side with the left (original) and right (new) values highlighted. You can export the diff as plain text, JSON, or as an RFC 6902 patch.
Common gotchas
- Array comparison mode matters. "By index" treats arrays as sequences and reports an inserted element as remove+add for everything after it. "By value" ignores genuine reorderings but useful for loosely-structured data. Match your mode to how your application actually uses the array.
- Type differences are structural.
{"id": 1}and{"id": "1"}show as a change because the types differ. If numeric strings should be equivalent, normalise one side before diffing. - RFC 6902 is one-directional. A patch generated here tells you how to apply changes, not how to merge two branches. Use a proper RFC 6902 implementation on the receiving end, not string replacement.
- Big diffs mean misaligned inputs. If the result is hundreds of operations, you're probably comparing unrelated documents or documents at different stages of a pipeline. Double-check you've pasted the right files.
- Floating-point precision. JSON has no native decimal type.
0.1 + 0.2may not equal0.3after serialisation. If exact numeric matching matters, compare at a lower precision.
Output formats
- Side-by-side view: Easiest for manual review. Shows old and new value for each changed path.
- Plain text: One change per line in readable format; good for grep or log files.
- JSON Patch (RFC 6902): Machine-readable format. Apply with a standard library to transform the left document into the right.