JSON Diff Tool

JSON 1 (Original) - Input

JSON 2 (New) - Input

About JSON Diff Tool

JSON Diff is a powerful comparison tool that helps you identify differences between two JSON objects or arrays. It performs deep comparison of nested structures, highlighting added, removed, modified, and renamed properties. The tool features intelligent property rename detection that identifies when a property name changes while maintaining the same value. This is essential for debugging API responses, comparing configuration files, validating data transformations, reviewing API changes across versions, comparing database records, validating JSON schemas, debugging data synchronization issues, and reviewing JSON exports from different sources. The tool handles complex nested objects, arrays, mixed data types, and provides a clear visual representation of all changes. Perfect for developers working with APIs, configuration management, data migration, QA testing, and JSON validation. All comparison happens in your browser for complete privacy and security.

How to Use

  1. Paste your original JSON in the left panel (JSON 1).
  2. Paste your new or modified JSON in the right panel (JSON 2).
  3. Click the "Compare" button to analyze the differences.
  4. View the highlighted JSON showing exactly what changed.
  5. Review the detailed differences table below.
  6. Use "Load Example" to see a sample comparison.
  7. Color codes: Green = Added, Red = Removed, Orange = Modified, Blue = Renamed.

Frequently Asked Questions

How does the JSON diff algorithm work?

The tool performs a deep recursive comparison of both JSON structures. It compares objects property by property, arrays element by element, and handles nested structures at any depth. For each path in the JSON, it identifies whether values are added, removed, or modified.

How does the syntax highlighting work?

After clicking Compare, the tool displays highlighted versions of your JSON showing the differences. Values that exist in only one JSON are highlighted in green (added) or red (removed), modified values are highlighted in orange, and renamed properties are highlighted in blue. This makes it easy to see exactly what changed at a glance.

How does property rename detection work?

The tool automatically detects when a property has been renamed by comparing values. If a property is removed from JSON 1 and a new property with the exact same value (deep comparison) appears in JSON 2, it's identified as a rename rather than a remove/add pair. For example, "dimensions_cm" becoming "dimensions" with the same value will be detected as a rename and highlighted in blue.

Can it compare arrays?

Yes! The tool compares arrays element by element using their index positions. It shows which array elements were added, removed, or modified. This is useful for comparing lists, API response arrays, and configuration arrays.

What does "modified" mean?

A property is marked as "modified" when it exists in both JSON objects but has different values. This includes changes in value (e.g., 30 to 31), changes in type (e.g., string to number), or changes in structure (e.g., object to array).

Can it handle deeply nested JSON?

Absolutely! The tool works with JSON of any depth. It will traverse through all nested objects and arrays, showing the complete path for each difference (e.g., address.street or roles[2]).

What if the JSON structures are completely different?

The tool handles structural differences gracefully. If the root types are different (e.g., object vs array), it will show this as a modification at the root level. Otherwise, it will identify all individual property and element differences.

How are null values handled?

Null values are treated as distinct values. Changing from null to any other value (or vice versa) is shown as a modification. Missing properties and null values are treated differently - missing is "removed/added", while null is a specific value.

Can I use this for API response validation?

Yes! This is perfect for API testing. Compare expected vs actual responses, track API changes across versions, validate data transformations, and debug response differences. The visual diff makes it easy to spot unexpected changes.

What does the path notation mean?

Paths show the exact location of each difference. Dots (.) separate object properties (e.g., "address.city"), and brackets ([]) show array indices (e.g., "roles[1]"). Nested paths combine both (e.g., "users[0].name").

Is my data safe?

Yes! All JSON comparison happens entirely in your browser using JavaScript. Your data never leaves your computer and is not sent to any server. You can even use this tool offline once the page is loaded.

What if my JSON is invalid?

The tool will display an error message for each panel with invalid JSON, explaining what's wrong. Fix the JSON syntax errors and the comparison will work automatically once both inputs are valid.

Can I compare large JSON files?

Yes, but very large files may take longer to process. The tool is optimized for typical API responses and configuration files. For extremely large files (megabytes), consider breaking them into smaller sections or using specialized tools.

Other Tools