# JSON diff

Canonical page: https://datalens.flazetech.in/json-diff

Publisher: DataLens by Flazetech (https://datalens.flazetech.in/about).

Compare JSON objects online and find added, removed, or changed values by path. This JSON diff ignores whitespace and object-key order, while preserving array order.

## How to compare two JSON documents

1. Paste the original JSON on the left and the updated JSON on the right.
2. Use Format both or the Format button above either editor to add readable indentation. Choose 2 spaces, 4 spaces, or tabs.
3. Select Compare JSON. Both documents are validated before comparison.
4. Review each added, removed, or changed path. Copy or download the difference report.

## Common questions

### Can I format JSON before comparing it?

Yes. Format both makes both documents readable in one step, or you can format and minify each input separately. The editors include syntax highlighting, line numbers, folding and undo. Formatting changes indentation; the comparison still ignores whitespace and object-key order.

### Does JSON key order affect the comparison?

No. Object keys are compared by name, regardless of their order or indentation. Array order is significant: array items are compared by index.

### What do added, removed, and changed mean?

Added means a key or index exists only in the updated document. Removed means it exists only in the original. Changed means the value or type at the same path differs.

### Can I compare nested JSON objects?

Yes. The comparison follows nested objects and arrays and reports their JSON paths. A number and a string containing the same digits are treated as different values.

### Is JSON diff the same as JSON Patch?

No. The downloadable report lists paths, change types, and before/after values for review. It is not an RFC 6902 JSON Patch document and should not be sent directly to a patch API.

## Related guides

- [How to format JSON and fix invalid JSON](https://datalens.flazetech.in/guides/format-validate-json)
- [Compare JSON objects without key-order noise](https://datalens.flazetech.in/guides/compare-json-objects)

## Data handling

[Processing and privacy](https://datalens.flazetech.in/privacy). Formatting and conversion run in the browser. Optional sharing and API requests can transmit supplied data. The interactive tools require JavaScript; this reference does not.
