JSON Compare
Compare two JSON documents and list every added, removed and changed value by its path.
RFC 8259Structural: whitespace and key order are ignored · limit 5 MB per side
Runs in your browser. Nothing you enter is sent anywhere. How to check
1.How to use
- Paste the original document into Original JSON.
- Paste the new version into Changed JSON. The list appears as you type.
- Read the list. Each row is one difference, with its path, the old value and the new value.
- If the order of items in your arrays does not matter, switch onIgnore array order.
Swap exchanges the two sides, so added and removed values trade places. If either side is not valid JSON, the error names the side, the line and the column.
2.Examples
Two API responses
Original:
{
"id": 4021,
"name": "orders-api",
"status": "active",
"regions": ["eu-west-1", "us-east-1"],
"retries": 3
}Changed:
{
"name": "orders-api",
"id": 4021,
"status": "paused",
"regions": ["us-east-1", "eu-west-1"],
"retries": 3,
"owner": "platform-team"
}The keys id and name moved, which is not a difference. The result is "4 differences: 1 added, 0 removed, 3 changed":
~ $.status:"active"→"paused"~ $.regions[0]and~ $.regions[1]: the two regions swapped places+ $.owner:"platform-team"
With Ignore array order on, the swapped regions match, and the result is "2 differences: 1 added, 0 removed, 1 changed".
3.Options explained
Structural comparison
Both documents are parsed and compared value by value. Whitespace, line breaks and the order of keys in an object never count as differences. Numbers are compared by value, so1.0 equals 1, and large integers are compared exactly, digit by digit. Strings are compared after escapes are read, so "é" equals"é". A value that changes type, such as "1" to 1, is shown as "type changed: string → number".
Ignore array order
Off (the default), arrays are compared position by position: [1, 2] and[2, 1] differ at both positions. On, items are matched by equal content wherever they are, so those two arrays are equal. Use it for lists that act as sets, such as tags, roles or permissions. Repeated items are matched by count: [1, 1, 2] and[1, 2] differ by one removed 1. An item whose content changed has no match, so it shows as one removed and one added row.
4.Limits
- Up to 5 MB per side. Above 1 MB in total, press Compare instead of the automatic run.
- The list shows the first 10,000 differences; the summary gives the total count.
- Strict JSON only, with the same rules and error messages as theJSON Formatter. Up to 1,000 levels of nesting.
- If a key appears twice in one object, its last value is compared and a warning names the side and the key.
5.FAQ
Why is key order ignored?
In JSON an object is an unordered set of name and value pairs (RFC 8259 §4). Two documents with the same keys in a different order mean the same thing, and many programs do not guarantee a stable key order.
How are arrays compared?
By position, unless you switch on Ignore array order. An item inserted at the start of an array therefore changes every later position. If that happens, try Ignore array order.
How is this different from a text diff?
A text diff compares lines, so reformatting or reordering keys shows up as changes. This tool compares the data, so only real changes to values appear, each with the exact path to it.
Is my data uploaded?
No. Both documents are compared in your browser. The privacy page shows how to confirm this in your browser's Network tab.