Skip to content
MyDailyTool

JSON Diff

Compare two JSON values semantically. Ignores key order; shows added, removed, and changed fields with their JSONPath — great for diffing API responses and config files.

2 added 1 removed 1 changed
  • $.tags[2] "beta"
  • $.address.city "NYC""Brooklyn"
  • $.deprecated_field "remove me"
  • $.new_field "added"
Normalized side-by-side (keys sorted)4 of 8 fields identical
{
"address": {
~ "city": "NYC",
"zip": "10001"
},
- "deprecated_field": "remove me",
"id": 42,
"name": "Alice",
"tags": [
"admin",
"user"
]
}
{
"address": {
~ "city": "Brooklyn",
"zip": "10001"
},
"id": 42,
"name": "Alice",
+ "new_field": "added",
"tags": [
"admin",
"user",
+ "beta"
]
}
Both inputs re-rendered with sorted keys and 2-space indent so a true line-for-line comparison is meaningful. Original input formatting in the textareas above is preserved.

How to use the json diff

Paste two JSON values side-by-side. The diff compares them semantically — by value, not by text — so key reordering is ignored. Added keys appear in green, removed in red, changed in amber, each with the JSONPath where the difference lives.

Formula & explanation

Semantic diff walks both values in parallel: objects are compared by union of keys, arrays element-by-element, primitives by equality. Output is a flat list of (path, change) pairs rather than a text diff.

Examples

Two responses with the same fields in a different order produce no diff. Adding a tag to an array shows as `+ $.tags[2]`. Changing a nested value shows as `~ $.address.city "NYC" -> "Brooklyn"`.

Frequently asked questions

Why not just use a text diff?
Text diff treats key order as significant — `{"a":1,"b":2}` and `{"b":2,"a":1}` look different even though they're semantically identical. APIs often return keys in different orders across calls (especially across language bindings), so text diff produces noise for working JSON.
How does array diffing work?
Element-by-element, by index. So `[1,2,3]` vs `[1,2,3,4]` shows as `+ $[3] 4`. `[1,2,3]` vs `[3,2,1]` shows three changes (every position differs). Set-style diffing where order doesn't matter is a different operation — for that, sort both arrays before pasting, or use the List Set Operations tool.
Can I diff two large JSON files?
The diff is in-browser and handles a few MB comfortably. Beyond that, browser JSON.parse + diff gets slow (seconds, not minutes). For multi-megabyte files, use a command-line tool like `jd` or `dyff`.
Does it handle JSON5 / comments / trailing commas?
No — strict JSON only. If your input has comments or trailing commas, strip them first (or paste through the JSON Formatter, which will reject them with a clear error).
What's JSONPath?
The standard syntax for pointing into a JSON document. `$` is the root, `.key` is an object property, `[i]` is an array index. So `$.users[2].name` means "the name of the third user." The same paths work in tools like jq (with slightly different syntax) and JSONPath libraries.

Related developer tools tools