Skip to content

JSON diff checker

Paste two JSON documents. See which fields were added, removed and changed, by path; compare arrays by position, by a key field or as an unordered set. For broken JSON it shows the line and column of the error.

Free tool · Integration

Paste a valid JSON document into each box (object, array or a single value). Key order does not matter.

The comparison runs in your browser; the JSON you paste is not sent anywhere.

Array comparison mode
Comparison rules
  • Paths start at the $ root: $.customer.name, $.items[0].qty; keys containing spaces or dots are written $["a b"]. In key-field matching an array item is named $.items[id=A-1].
  • Key order in objects is ignored. Numbers are compared by value (1 and 1.0 are the same); strings exactly.
  • A type change ("77" → 77, null → object) is counted separately and is not descended into. An added or removed object/array is written as a single difference.
  • In unordered-set mode matching items produce no difference; unmatched ones become "removed" at their position in the old array and "added" at their position in the new one.
  • JSON is read strictly (RFC 8259): comments, trailing commas, single quotes and unquoted keys are errors. With a duplicate key the last value applies and a warning is given.

The comparison relies on structure and value equality; it does not know the meaning, unit or business rule of a field. A difference is not always an error (for example a timestamp or a generated identifier). Be careful when copying the report into places where you share confidential data.

Let us design together the contract, versioning and drift control for the messages flowing between your systems.

Request a call

01

How to use

  1. A

    Paste the old JSON into box A and the new JSON into box B (or load the example).

  2. B

    Choose the mode for arrays: by position, by key field (for example id) or as an unordered set.

  3. C

    Look at the summary counts and the path-based list of differences; copy the report. If the JSON is broken, the error is shown with line and column.

02

A structural diff, not a text diff

A line-by-line text comparison produces meaningless differences when key order or whitespace changes. This tool parses both documents and compares them as structure: key order and formatting are not differences, field paths and values are. The result answers directly the question "which field was added, removed or changed".

A type change is shown separately because it is one of the sneakiest errors in integrations: "77" (text) and 77 (number) behave differently in many systems but often look the same to the eye.

03

Comparing arrays

Arrays are the hardest part of JSON because two arrays need a definition of "the same item". In by-position mode item i is matched with item i: when the order changes every item looks changed. In by-key-field mode object items are matched by the value of a field (for example id, sku), so only items that were really added, removed or changed appear.

Unordered-set mode compares arrays whose order is meaningless (like a tag list) by deep equality. If an item changed, this mode shows it as "one removed, one added" because nothing identifies which items belong together. For items where order and identity matter, prefer key-field mode.

04

What is it good for in integrations?

Common uses are comparing the response of a new API version with the old one, catching drift from the contract, comparing the configuration in two environments (test and production) or the same record in two systems. The report can be pasted into a ticket or a change request.

Dynamic fields (timestamps, generated identifiers, sequence numbers) show a difference on every comparison; you have to filter these out by eye. For large, continuously running comparisons an automated contract test is recommended instead of this tool.

FAQ

Does a different key order count as a difference?
No. In objects the key order is meaningless in JSON and is ignored; only field paths and values are compared. In arrays order is meaningful (except in unordered-set mode).
Which mode should I choose for arrays?
By position for arrays where order is meaningful (time series, steps). By key field for record lists that have an identifier (order lines, users), entering the field name. Unordered set for lists where order is meaningless, such as tags.
Why do I get a "compared by position" notice in key-field mode?
If the key field is missing in an item, an item is not an object or the same key value repeats, matching would not be reliable; the tool compares that array by position and tells you which arrays. For lists of non-objects such as numbers and strings, try unordered-set mode.
Are 1 and 1.0, or 1 and "1", the same?
1 and 1.0 are the same number, so there is no difference. 1 (number) and "1" (string) are different types and are shown as "type changed".
Can I compare very large JSON files?
Each side can be at most 5 million characters; because it runs in the browser, the page may slow down with very large files. At most the first 5,000 differences are listed, while the summary counts are complete.
Is the JSON I paste sent anywhere?
No. Parsing and comparison run entirely in your browser; no network request is made.

Secure your message contracts

Let us design together the contract, versioning and drift control for the messages flowing between your systems.