ToolHarbor

JSON Diff

Compare two JSON objects and see added, removed, and changed values highlighted with their paths.

Features

  • Semantic comparison of JSON structure and values
  • Highlights added, removed, and changed keys with dot-path notation
  • Shows old and new values side by side
  • Option to sort keys for order-independent comparison
  • Validates both inputs before comparing
  • Works entirely offline — your data never leaves your browser

How to Use

  1. 1Paste the original JSON in the left input field
  2. 2Paste the modified JSON in the right input field
  3. 3Optionally enable "Sort keys" for order-independent comparison
  4. 4The diff results appear automatically below
  5. 5Review added (+), removed (−), and changed (~) entries

Examples

Detecting changed values

Input

{"name":"John","age":30}
→
{"name":"John","age":31}

Output

~ age: 30 → 31
Detecting added and removed keys

Input

{"name":"John","role":"admin"}
→
{"name":"John","email":"john@test.com"}

Output

− role: "admin"
+ email: "john@test.com"

What Is JSON Diff?

JSON diff is a semantic comparison of two JSON documents that identifies exactly what changed between them. Unlike a plain text diff that compares line by line, a JSON diff understands the data structure — it knows that {"a":1,"b":2} and {"b":2,"a":1} are equivalent, and it can show you that a specific nested key three levels deep changed from one value to another.

This tool compares JSON at the key/value level and reports four types of differences: added keys (present in modified but not original), removed keys (present in original but not modified), changed values (same key, different value), and unchanged entries. Each difference is shown with its full dot-notation path, making it easy to locate changes in deeply nested structures.

The "Sort keys" option enables order-independent comparison. JSON objects are unordered by specification, so {"a":1,"b":2} and {"b":2,"a":1} should be considered identical. With sort keys enabled, the tool ignores key order differences and focuses only on actual data changes.

Common use cases include: comparing API responses between environments (staging vs production), reviewing configuration file changes, debugging data transformations, verifying migration scripts, and validating test fixtures. Any time you need to know exactly what changed between two JSON documents, this tool gives you a clear, structured answer.

Everything runs in your browser. Your JSON data is never sent to any server. Whether you are comparing API keys, user records, or internal config files, the comparison happens entirely on your device.

Frequently Asked Questions

Related Tools