Developer ToolboxRFC 8259
New here? Take a 30-second tour of how this page works.

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

  1. Paste the original document into Original JSON.
  2. Paste the new version into Changed JSON. The list appears as you type.
  3. Read the list. Each row is one difference, with its path, the old value and the new value.
  4. 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":

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

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.