JSON Diff
Compare two JSON objects. The diff highlights added, removed, and changed fields.
Input A (Original)
Loading editor...
Input B (Modified)
Loading editor...
Diff Result
Read-Only Comparison
Loading diff editor...
Comparing two API responses, config versions, or database documents? Paste them side by side and instantly see every addition, deletion, and modification — even in deeply nested structures.
Last Updated: April 20, 2025Privacy: 100% Local Browser Processing
What is the Json Diff?
A JSON Diff tool compares two JSON objects or arrays and visually highlights every difference between them — additions, deletions, and modifications. It performs deep recursive comparison on nested structures, making it invaluable for debugging API responses, comparing configuration file versions, or reviewing data changes between deployments. The color-coded output makes it immediately clear what changed, what was added, and what was removed.
Technical Deep Dive
The diff algorithm works by recursively traversing both JSON trees simultaneously. At each level, it compares keys and values: if a key exists in the left object but not the right, it is marked as a deletion (red). If a key exists in the right but not the left, it is an addition (green). If both sides have the same key but different values, the tool recursively compares the values — for primitives, it shows the old and new values; for objects and arrays, it continues the recursive descent. Array comparison is index-based: element at position 0 in the left is compared to position 0 in the right. This approach ensures that even deeply nested structures (common in GraphQL responses with 5+ levels of nesting) are compared accurately. The diff output is generated as a structured data representation, then rendered with syntax highlighting to make visual scanning fast and intuitive.
Real-World Use Cases
- API regression testing — compare the response from a staging server against production to catch unexpected data changes before deployment.
- Configuration auditing — diff Kubernetes ConfigMaps, Terraform state files, or application configs between environments (dev vs. staging vs. production).
- Database document comparison — compare two MongoDB documents or Firestore snapshots to understand what fields changed during a data migration.
- Pull request review — compare the before and after states of JSON configuration files in a code review.
How to Use
- 1Paste the first JSON object into the left panel.
- 2Paste the second JSON object into the right panel.
- 3Differences are highlighted instantly with color coding.
- 4Green indicates additions, red indicates deletions, and yellow indicates changes.
- 5Copy or download the diff report for documentation.
Pro Tips & Best Practices
- Format both JSON objects before comparing — the diff tool compares structure, not whitespace, but formatted input makes it easier to verify the results visually.
- For array comparisons, remember that the tool compares elements by index position. If you inserted an element in the middle, everything after it will appear as changed.
- Use this tool to verify that your API serialization is consistent — compare the output of the same endpoint at different times to catch timestamp drift or ordering changes.