Skip to content
4all.tools

Compare JSON Documents Online

Compare two strict JSON documents by value. Review added, removed, and changed values with localized diagnostics and bounded previews.

Tool workspace

Compare JSON documents

JavaScript is required to compare JSON in your browser.

Enter strict JSON text to compare.

Enter strict JSON text to compare.

  • Compare JSON values by meaning, not by whitespace or object key order.
  • Array items are compared by position.
  • Each input can contain up to 1,000,000 UTF-16 code units.

Comparison runs locally in your browser. Your JSON is not sent to a server.

Comparison actions

No comparison yet.

No comparison yet.

Compare two JSON documents

Paste the earlier document in Previous JSON and the newer document in New JSON, then choose Compare. The result lists each semantic change with its JSON path and the values before and after. The summary counts added, removed, and changed values separately. A new property is an addition, a missing property is a removal, and a different value at an existing path is a change.

For example, this pair has two additions and two changes:

{
  "profile": { "active": true, "region": "west" },
  "tags": ["blue", "old"]
}
{
  "tags": ["blue", "new", "extra"],
  "profile": { "region": "west", "active": false },
  "note": null
}

The additions are $.note and $.tags[2]. The changes are $.profile.active and $.tags[1]. The summary is 2 added, 0 removed, 2 changed, 4 total. Reordering the keys under profile does not add a change.

How JSON values are compared

Whitespace and object property order do not affect the comparison. Array items are matched by their index, so inserting an item near the start can change the values at several later positions. A missing property is different from a property whose value is null; null, the string "null", and an empty string are also distinct values.

When a value changes to a different JSON type, the tool reports one change for that path instead of listing every difference inside the replaced value:

{"profile":{"name":"Ada","roles":["reader","editor"]}}
{"profile":"archived"}

This is one change at $.profile. The previous object subtree and the new string are the two values for that record.

Strict JSON and number precision

Both inputs must be strict JSON. Comments, trailing commas, single-quoted strings, and duplicate property names are rejected. Diagnostics identify the input side and include a line, column, or path only when the parser provides that information. A long diagnostic list may be marked as incomplete.

JSON numbers are represented as JavaScript numbers during comparison. Very large or highly precise numbers can lose precision during parsing; the tool shows a warning when the parser detects that risk. The comparison is between the represented JSON values, not arbitrary-precision mathematical numbers or the original number spelling.

Input, operation, and preview limits

Each input is limited to 1,000,000 UTF-16 code units. Parsing also limits nesting to 200 levels, 100,000 nodes, 100 diagnostics, and 1,000,000 parsing work units per document. The comparison has a budget of 1,000,000 work units and at most 1,000 change records. The complete presentation is limited to 2,000,000 UTF-16 code units, and an operation can wait up to 15 seconds for its worker result.

Change rows display complete JSON previews up to 512 UTF-16 code units per value. A larger value is shown as a summary with its JSON type and number of items, keys, or code units; it is still compared as a whole. The result is shown in pages of 50 rows, while its counts describe the complete comparison. Reduce the input or make a smaller change if a stated limit is reached.

Local processing and cancellation

Parsing and comparison run locally in your browser. The input text is not sent to an application server. Choose Cancel to stop a comparison that is still running; both text boxes remain unchanged. Inputs are not saved automatically by this tool.