# JSON Diff

> Compare two JSON documents structurally and list added, removed and changed values by JSON path. Key order is ignored; arrays can be compared as sets.

- URL: https://www.tooljig.com/json-diff
- Category: [Developer tools](https://www.tooljig.com/category/developer.md)
- Runs: In the browser; nothing uploaded
- Price: free, no account needed

## What it does

Paste two JSON documents to see exactly what differs, as a list of paths such as $.items[2].price: 9.99 → 10.49. The comparison is structural, not line by line, so reordered object keys or different indentation do not count as changes. A summary shows how many values were added, removed and changed, and invalid JSON is reported with its line and column.

## How to use it

1. Paste the original JSON on the left and the new JSON on the right.
2. Optionally compare arrays of plain values as unordered sets or ignore whitespace-only string changes.
3. Read the summary and the list of differences, and copy it as text.

## Good to know

- Arrays are compared position by position, so inserting an item near the start reports every later item as changed. The unordered option only applies to arrays that contain nothing but strings, numbers, booleans and null.
- Numbers are compared after parsing, so 1.0 and 1 are equal, and very large integers lose precision as in any JavaScript JSON parser. Duplicate keys keep their last value.

## FAQ

### Does key order matter?

No. {"a":1,"b":2} and {"b":2,"a":1} are equal, as JSON objects are unordered.

### What does the path $.items[2].price mean?

It is JSONPath-style notation: $ is the document root, .items is a key and [2] is the third array element (counting from zero). Keys that are not plain identifiers are written in brackets, such as $["first name"].

### Is my JSON uploaded?

No. Both documents are parsed and compared in your browser.

## Related tools

- [JSON Formatter](https://www.tooljig.com/json-formatter.md): Format, validate and minify JSON with clear error messages that point to the line and column. Runs entirely in your browser.
- [Text Compare](https://www.tooljig.com/text-compare.md): Compare two texts line by line and see what was added or removed. Runs locally in your browser, so nothing is uploaded.
- [JSON to CSV](https://www.tooljig.com/json-to-csv.md): Flatten JSON arrays into spreadsheet-ready CSV.
