JSON Diff

Compare two JSON objects and visualize differences with detailed change tracking

Enter or paste the first JSON object to compare

Enter or paste the second JSON object to compare

Comparison results showing added, removed, and modified properties

What is JSON Diff?

JSON Diff compares two JSON objects and identifies all differences between them. It detects added properties, removed properties, and modified values at any depth of nesting. This tool is essential for debugging API changes, comparing configuration files, and tracking data modifications. All comparisons happen in your browser - your data never leaves your device.

How to Use the JSON Diff Tool

  1. Paste your first JSON object into the "Left JSON" field
  2. Paste your second JSON object into the "Right JSON" field
  3. Click "Compare" to see all differences
  4. Review the results showing added (+), removed (-), and modified (~) properties
  5. Copy the results using the "Copy Results" button

Example: Comparing JSON Objects

Left JSON:

{
  "name": "John Doe",
  "email": "john@example.com",
  "age": 30,
  "role": "developer"
}

Right JSON:

{
  "name": "John Doe",
  "email": "john.doe@example.com",
  "age": 31,
  "department": "engineering"
}

Diff Results:

Found 3 difference(s):
  Added: 1
  Removed: 1
  Modified: 2

Details:
  ~ email:
      Left:  "john@example.com"
      Right: "john.doe@example.com"
  ~ age:
      Left:  30
      Right: 31
  - role: "developer"
  + department: "engineering"

Key Features

  • Deep Comparison: Detects differences at any nesting level
  • Array Support: Compares arrays element by element
  • Type Detection: Identifies type changes (string to number, etc.)
  • Web Worker Processing: Uses background threads for large files (>100KB)
  • Clear Visualization: Shows added (+), removed (-), and modified (~) properties
  • Path Tracking: Displays the exact path to each difference
  • 100% Client-Side: Your data never leaves your browser

When to Use JSON Diff

  • API Testing: Compare API responses before and after changes
  • Configuration Management: Track changes in config files
  • Data Migration: Verify data transformations are correct
  • Version Control: Review JSON changes in pull requests
  • Debugging: Identify unexpected data modifications
  • Schema Validation: Compare actual data against expected structure

Understanding Diff Results

  • Added (+): Properties that exist in the right JSON but not in the left
  • Removed (-): Properties that exist in the left JSON but not in the right
  • Modified (~): Properties that exist in both but have different values
  • Path Notation: Uses dot notation (object.property) and brackets ([index]) for arrays

Performance Optimization

For large JSON files (over 100KB combined), the tool automatically uses Web Workers to perform the comparison in a background thread. This keeps the user interface responsive while processing large datasets. You'll see a processing indicator when this happens.

Frequently Asked Questions

What is JSON diff?

JSON diff is a comparison tool that identifies all differences between two JSON objects. It shows you exactly what properties were added, removed, or modified, making it easy to track changes in structured data. This is especially useful for debugging, testing, and version control.

How does the tool handle nested objects?

The tool performs deep comparison, meaning it recursively compares all nested objects and arrays at any depth. Each difference is reported with its full path, so you can see exactly where in the structure the change occurred. For example, "user.address.city" shows a change in the city property nested within address within user.

Can it compare arrays?

Yes! The tool compares arrays element by element. It detects when array elements are added, removed, or modified. Array differences are shown with bracket notation, like "[0]" for the first element or "[2].name" for a property within an array element.

What happens with large JSON files?

For files larger than 100KB combined, the tool automatically uses Web Workers to perform the comparison in a background thread. This prevents the browser from freezing and keeps the interface responsive. You'll see a processing indicator while the comparison is running.

Is my data sent to a server?

No, all JSON comparison happens entirely in your browser. Your data never leaves your device, ensuring complete privacy and security for sensitive information. This also means the tool works offline once the page is loaded.

Can I compare invalid JSON?

No, both JSON inputs must be valid. If either input has syntax errors, the tool will display an error message indicating which side has the problem. You can use our JSON Validator tool to check your JSON syntax before comparing.

How do I interpret the diff results?

The results show three types of changes: Added (+) means the property exists in the right JSON but not the left; Removed (-) means it exists in the left but not the right; Modified (~) means the property exists in both but with different values. Each difference includes the full path and the values from both sides.

Can I compare JSON with different structures?

Yes! The tool handles JSON objects with completely different structures. It will identify all properties that exist in one but not the other, as well as any shared properties that have different values. This makes it useful for comparing data from different API versions or schema migrations.