velkaro.Runs in your browser

JSON diff: compare two JSON documents by path

Paste or drop two versions. Every added, removed and changed value is listed with a path you can follow, and the list updates as you type.

Compare JSON

Example Two versions of an API response. Paste your own JSON to replace them.

valid object · 23 keys · 541 B
valid object · 19 keys · 475 B
Updates as you type
Apply a JSON Patch to A

Paste an RFC 6902 patch (add, remove, replace, move, copy, test). It is applied to a copy of A and the result goes into B, so the report below shows what the patch changed. If any operation fails, nothing is changed.

10 changes

Matched 1 array by "id"; item order inside them is ignored.

Changed$["status"]
A · Before
"pending"
B · After
"shipped"
Changed$["updatedAt"]
A · Before
"2026-10-18T09:12:00Z"
B · After
"2026-10-19T14:30:00Z"
Changed$["customer"]["tier"]
A · Before
"standard"
B · After
"member"
Changed$["items"][?@["id"]==11]["qty"]
A · Before
2
B · After
3
Removed$["items"][?@["id"]==12]
A · Before
{
  "id": 12,
  "sku": "TEE-M",
  "qty": 1,
  "price": 24
}
B · After
(absent)
Changed$["tags"][0]
A · Before
"gift"
B · After
"priority"
Changed$["tags"][1]
A · Before
"priority"
B · After
"gift"
Changed$["total"]

Type changed: number → string

A · Before
67
B · After
"55.50"
Removed$["discount"]
A · Before
null
B · After
(absent)
Added$["tracking"]
A · Before
(absent)
B · After
"1Z999AA10123456784"
JSON Patch is available when arrays are not matched by id.

Comparison complete. Nothing was uploaded.

What the report tells you

Exact paths

Every change points to a field such as $["settings"]["theme"]. Bracket notation keeps keys with dots or spaces unambiguous. JSON Patch uses the matching pointer, /settings/theme.

Types are kept

1 and "1" are different, and a missing key is different from null. A type change is labelled, for example number → string.

Arrays, three ways

By position (default), as an unordered collection, or by an id property so a deleted item in the middle does not make every later item look changed.

Clear errors

Invalid JSON is reported with its line and column and a plain reason: trailing comma, comment, single quotes. Go to error puts the cursor there.

How to compare two JSON files

  1. Add both versions. Paste JSON, select Open file, or drop a .json file on each editor. Invalid JSON is marked with its line and column.
  2. Set what counts as a difference. Key order and formatting never count. Choose how arrays are compared, and list keys such as updatedAt or one exact path to skip.
  3. Read and export the result. Filter by Added, Removed or Changed or by path, or switch to a line-by-line view. Copy a path, then download the report, a JSON Patch, a .diff file or a plain-text summary.

API responses

Compare a saved response with today’s, ignore request ids and timestamps, and match records by id so a deleted item does not shift the rest.

Test fixtures and snapshots

See which field broke a snapshot test. Paths such as $["items"][2]["price"] point straight at it.

Questions

How do I compare two JSON files online?

Open a file, drop it on an editor or paste JSON into each side. The list of added, removed and changed values updates as you type, each with its exact path. Large documents are compared when you select Compare.

Does object key order matter?

No. JSON object properties are matched by name, and formatting is ignored. Array positions are compared by default.

How do I compare arrays of objects that moved?

Enter the identifying property, such as id, in Match array items by. Items with the same id are compared with each other wherever they sit in the array. If any item lacks the property or an id repeats, that array is compared by position instead.

What does Ignore array order do?

It compares the contents of an array without considering position. If the contents differ, the whole array appears as one change so the report does not pretend to know which item moved.

Can I hide timestamps and request IDs?

Yes. List property names such as updatedAt, requestId in Ignore keys. They are skipped at every depth.

Can I ignore a field in one place only?

Yes. Ignore keys skips a name at every depth. Ignore paths skips one location, written as a JSON Pointer such as /items/0/updatedAt. Select Ignore on a change to add its path. When array items are matched by id, the index in the path is the item’s position in A.

Are long IDs and exact decimals compared correctly?

Yes. Numbers are compared by their exact decimal value, so 12345678901234567890 and 12345678901234567891 are different even though JavaScript rounds both to one number. 1.10 and 1.1 have the same value, so they are not listed as a change; the report says how many numbers differ only in how they are written. See how numbers are compared.

What is the JSON Patch export?

An RFC 6902 list of add, remove and replace operations that turns the original document into the updated one. It is available when arrays are compared by position or as whole arrays. Ignored keys are left out of the patch. See the JSON Patch generator notes for a worked example.

Can I compare JSON from an API response with a saved fixture?

Yes. Paste the saved response as A and the new response as B, list volatile fields such as updatedAt or requestId in Ignore keys, and match lists of records by their id. Download the report to attach it to a bug or a pull request.

Can I see the differences line by line or as a .diff file?

Yes. Select Line by line to see both documents formatted with sorted keys and compared line by line, with line numbers. Download .diff saves the same comparison as a unified diff that git apply, patch and code review tools read. Ignore keys and Ignore paths apply there too; array matching applies only to the list by path.

Can I apply a JSON Patch to check it?

Yes. Open Apply a JSON Patch to A, paste an RFC 6902 patch and select Apply. The patch is applied to a copy of A, the result goes into B, and the report shows what it changed. All six operations are supported, including test. If any operation fails, nothing is changed and the failing operation is named.

Is my JSON uploaded?

No. Your text and files are read and compared in this browser tab. Only your comparison options are remembered in this browser; your JSON is not saved.

Worked examples

JSON comparison guide

Follow a worked JSON diff, download both sample files, and see how array order and id matching change a report. Then read how to generate and apply a JSON Patch or compare JSON ignoring array order. Choosing a tool? We ran five free JSON diff checkers on the same file. Working in code instead: JSON diff in Python with DeepDiff, jsondiff and jsonpatch, or compare JSON in VS Code, jq and git diff. Comparing YAML files? Run each through the YAML to JSON converter first; to go the other way, use JSON to YAML. The guides also cover YAML comments, multiline strings, anchors and the values that change type between YAML 1.1 and 1.2.