JSON Diff

Compare two JSON objects structurally and detect every addition, removal, and change.

About This Tool

The JSON Diff tool lets you compare two JSON objects and instantly see every structural difference between them. Whether you are debugging an API that returns unexpected data, reviewing configuration changes before deployment, or validating that a migration script transformed records correctly, this tool gives you a clear, color-coded breakdown of what was added, removed, or modified.

Unlike plain text diff tools that compare line by line, this tool performs a deep structural comparison. It recursively walks both JSON trees, matching keys and array elements to produce semantic diffs. This means reordering keys in an object does not produce false positives — the comparison is key-order independent by default. You can also toggle array-order independence when the position of items in a list does not matter.

All processing happens entirely in your browser. No data is uploaded to any server, making it safe for sensitive payloads such as API responses containing authentication tokens, internal configuration files, or database records with personally identifiable information. The tool uses native JavaScript APIs with no external diff libraries, keeping the page lightweight and fast.

Results are displayed in an interactive tree view that mirrors the structure of your JSON data. Additions are highlighted in green, removals in red, and value changes in amber with both the old and new values shown side by side. A flat list view is also available for quick scanning. You can copy the full diff output as a JSON array for documentation, code reviews, or automated testing workflows.

How to Use

  1. Paste your original JSON into the Original JSON textarea on the left.
  2. Paste the modified JSON into the Modified JSON textarea on the right.
  3. Click Compare (or press Ctrl+Enter) to run the structural diff.
  4. Review the color-coded tree view: green for additions, red for removals, and amber for changes.
  5. Toggle Ignore array order if element position does not matter for your comparison.
  6. Click Copy Diff to copy the diff results as a JSON array, or use Ctrl+Shift+C.
  7. Use the Sample button to load example data and explore the tool's features.

Popular JSON Diff Examples

View all JSON Diff examples →

FAQ

Is my data safe when using this tool?

Yes. All comparison logic runs entirely in your browser using JavaScript. No data is sent to any server. Your JSON inputs never leave your machine, making it safe for sensitive or proprietary data.

Does key order affect the comparison?

No. The diff engine compares objects by their keys regardless of the order they appear in. Two objects with the same keys and values are considered identical even if the keys are listed in a different order.

What does "Ignore array order" do?

When enabled, arrays are compared as sets rather than ordered lists. This means [1, 2, 3] and [3, 1, 2] are treated as equal. This is useful when the order of items does not carry meaning, such as lists of tags or feature flags.

What types of differences are detected?

The tool detects four kinds of differences: added keys or array elements that exist only in the modified JSON, removed keys or elements that exist only in the original, changed values where the same key has a different value, and type changes where a value's type differs (for example, a string replaced by a number).

Can I compare very large JSON files?

The tool works well for JSON documents up to several megabytes. For extremely large files, performance depends on your browser and device. The recursive diff algorithm is efficient, but very deeply nested structures with thousands of keys may take a moment to process.

How do I use the diff output in my workflow?

Click Copy Diff to copy the results as a JSON array. Each entry includes the path, diff type, and old/new values. You can paste this into code reviews, documentation, or use it in automated test assertions to verify expected changes.

What keyboard shortcuts are available?

Press Ctrl+Enter to run the comparison and Ctrl+Shift+C to copy the diff output to your clipboard.

Related Tools