JSON Diff

Your data never leaves your browser

Compare two JSON objects and see every added, removed, and changed property. Deep recursive diff with full path notation.

JSON A
JSON B
Paste JSON into both panels to compare
Ctrl+KClearDiff updates as you type

Share this tool

Found it useful? Help a fellow developer discover it.

https://developertoolkit.dev/tools/json-diff

How JSON Diff works

The diffing engine recursively walks both JSON structures simultaneously. For objects, it compares all keys from both sides and reports added, removed, or changed values. For arrays, it compares elements at the same index (positional diffing). Each change is reported with its full dot-notation path. For example, user.address.city or items[2].price.

If the types at a given path differ (e.g., one side has a string and the other has a number), it is reported as a Type Changed entry rather than recursing further.

Change types

+ Added

A key exists in JSON B but not in JSON A. The value from B is shown.

− Removed

A key exists in JSON A but not in JSON B. The value from A is shown.

~ Changed

The same key exists in both, but the values differ. Old and new values are both shown.

Type Changed

The same key exists in both, but the value types differ (e.g., string vs. number). Diffing stops at this node.

When to use JSON Diff

Frequently Asked Questions

How do I compare two JSON files online?

Paste the first JSON object into the left panel and the second into the right panel. The diff runs automatically and the results appear below showing every added, removed, changed, or type-changed property with its full path. Both sides are validated as you type. If either side contains invalid JSON, an error is shown and diffing pauses until the syntax is fixed.

Can I diff minified JSON?

Yes. Both panels accept minified or formatted JSON. The diff engine parses the JSON structure regardless of whitespace, so minified and pretty-printed versions of the same object are treated as identical. If you want to compare formatted versions visually, run both through the JSON Formatter first.

What is the difference between JSON Diff and Text Diff?

Text Diff compares two files line by line. It treats JSON as plain text, which means reformatting (changing indentation or key order) appears as many changes even when the data is semantically identical. JSON Diff parses the JSON structure and compares it semantically, so key reordering and whitespace changes produce no diff output. JSON Diff is the right tool for comparing data. Text Diff is the right tool for comparing exact file contents.

Does key order matter in JSON Diff?

No. JSON objects are unordered by specification and this diff tool compares keys semantically, not by position. {"a": 1, "b": 2} and {"b": 2, "a": 1} are considered identical.

How does the tool handle arrays?

Arrays are compared positionally. Element [0] from the left is compared to element [0] from the right, and so on. If one array is longer, the extra elements are reported as added or removed. If your arrays represent sets (order-independent), the positional diff may show more changes than expected.

Can I compare nested objects?

Yes. The diff is fully recursive. It walks into nested objects and arrays at any depth. Each change is reported with its full dot-notation path such as user.address.city or items[2].price.

What happens if my JSON is invalid?

The editor for the invalid side shows an error indicator. Both sides must be valid JSON for the diff to run. Common mistakes are trailing commas (not allowed in standard JSON), single quotes instead of double quotes, and unquoted keys. Use the JSON Formatter tool to auto-fix common syntax errors.

Does this tool send my JSON to a server?

No. All diffing runs entirely in your browser. Paste production API responses, config files, and database exports without concern.

Related Tools