JSON Diff
Compare two JSON objects and highlight differences instantly online. Free JSON diff tool that formats both inputs and shows added, removed, and unchanged lines. No signup required.
Left (Original)
Right (Modified)
Related Tools
JSON → YAML
Convert JSON to YAML format instantly. Supports nested objects, arrays, and complex structures.
YAML → JSON
Convert YAML to JSON format instantly. Supports multi-document YAML and complex configurations.
CSV → JSON
Convert CSV to JSON array instantly. Automatic header detection and type inference.
JSON diff compares two JSON documents semantically rather than textually: it normalizes both inputs to a consistent format (sorted keys, consistent indentation) before computing the difference, so purely cosmetic differences in whitespace or key ordering do not produce noise in the output. This produces a meaningful diff of data structure changes rather than formatting changes.
API response comparison is a common use case: comparing a JSON response between API versions, comparing the output of two different environments (staging vs. production), verifying that a database migration preserved record structure, or auditing changes to JSON-based configuration stored in AWS AppConfig, LaunchDarkly, or similar systems.
This tool formats both JSON inputs with JSON.stringify() at 2-space indentation before diffing, ensuring that key ordering and whitespace are normalized. It then uses the diff library to compute a line-level diff of the formatted outputs and renders added lines in green and removed lines in red, making structural and value changes immediately visible.
Common Use Cases
Comparing API responses across versions
When releasing a new version of a REST API (v1 → v2), teams need to verify that the response schema changes match the documented breaking changes. Pasting the v1 and v2 responses for the same resource into a JSON diff reveals added fields, renamed keys, changed data types, and removed properties — providing evidence for the API changelog.
Auditing Terraform state file changes
Terraform state files are JSON documents tracking infrastructure resource attributes. Before applying a terraform plan that modifies existing resources, engineers compare the current state file against the planned new state to understand the full scope of attribute changes — catching unintended modifications to security groups, IAM policies, or database parameters.
Debugging staging vs. production discrepancies
When an application behaves differently in staging than production, the culprit is often a configuration difference. Comparing the JSON configuration documents (feature flags from LaunchDarkly, environment configs from AWS AppConfig, or database seed fixtures) across environments identifies which specific values differ and explains the behavioral divergence.
Verifying database migration output
After running a data migration script on a MongoDB collection or a JSON-column PostgreSQL table, teams export a sample document before and after migration as JSON and diff them. This confirms that the migration transformed the correct fields, preserved unchanged fields, and produced the expected new structure without data loss or unintended side effects.
How to Use the JSON Diff Tool
- Paste the first JSON in the left panel and the second in the right panel.
- Both JSONs are automatically formatted before comparison so whitespace differences are ignored.
- Added lines appear in green and removed lines in red.
- The toolbar shows the count of added, removed, and unchanged lines.
Common Uses
- Comparing API response payloads between environments
- Reviewing config file changes in pull requests
- Auditing JSON data migrations
- Debugging data transformation pipelines