JSON Diff & Compare
Compare two JSON documents and list every value that was added, removed or changed, with its path. The comparison is semantic: key order and formatting never matter, and arrays can be compared by index, regardless of order or by matching objects on a key field. Volatile paths can be ignored, and the result can be exported as a JSON Patch or a text report. Everything runs in your browser.
How to use
- Paste the original JSON on the left and the changed JSON on the right, load .json files, or click Load sample.
- Choose how to compare arrays: by index, ignoring order, or matching objects by a key field such as id.
- Optionally treat numbers and strings as equal, ignore upper/lower case in string values, or list paths to ignore, one per line (for example $.meta.updatedAt or $.items[*].id).
- Click Compare (or press Ctrl+Enter / ⌘+Enter), filter the differences by type and copy the path of any row.
- Copy or download the JSON Patch, or copy the text report.
Example
Input
Original JSON:
{"id":7,"plan":"free","tags":["a","b"],"note":null}
Changed JSON:
{"plan":"pro","id":7,"tags":["a","b","c"]}Output
JSON Diff & Compare
Added: 1 · Removed: 1 · Changed: 1
[Changed] $.plan: "free" → "pro"
[Added] $.tags[2]: "c"
[Removed] $.note: nullFrequently asked questions
Is key order or whitespace reported as a difference?
No. Both documents are parsed first, so reordered keys, indentation and line breaks are never reported. A key set to null and a missing key are different, though.
How are duplicate or missing keys handled when matching by key field?
Items that share the same key are paired in order of appearance, and items without the key are paired with each other in order. Whatever is left over is listed as added or removed, so no item is dropped.
When can I export a JSON Patch?
When arrays are compared by index, both tolerance options are off, no paths are ignored and no number had to be rounded. The patch follows RFC 6902 and turns the original JSON into the changed JSON.
What happens with very large numbers?
Integers beyond 2^53 and numbers with too many digits cannot be represented exactly in the browser. The tool warns you when a document contains them, because a difference between such numbers may be missed.
Is my JSON sent to a server?
No. Parsing, comparing and exporting happen entirely in your browser.