Skip to content

JSON Diff

Paste two JSON documents and see what was added, removed or changed between them, with the path of each change.

Before
After
Differences

Added

1

Removed

1

Changed

3

  • Changed$.status"placed" → "shipped"
  • Changed$.items[0].qty200 → 250
  • Removed$.items[1].backordertrue → nothing
  • Added$.items[2]nothing → {3 keys}
  • Changednull to string$.notesnull → "Leave at dock"
5 differencesbefore 269 B · after 321 BCompared in this tab, no request made

Nothing you paste is uploaded. The server sends connect-src 'self', so your browser blocks this page from contacting any other host. Check it yourself

Compare two JSON documents by structure: keys added, removed or changed, each with its path. Key order and spacing are ignored. Runs in your browser tab.

How the comparison works

Both documents are parsed, then walked together. Object keys are matched by name, so the order in which they were written does not matter. Array items are matched by position. Each place where the two differ is listed with its path, which starts at $, the whole document.

~ $.status: "placed" -> "shipped"
~ $.items[0].qty: 200 -> 250
- $.items[1].backorder: true
+ $.items[2]: {"sku":"WASHER-M6","qty":500,"unitPrice":0.02}
~ $.notes: null -> "Leave at dock"

That is the report for the sample on this page. + marks an added value, - a removed one and ~ a changed one. Copy report puts these lines on the clipboard, all of them.

What counts as a difference

Indentation, line breaks and key order are not differences. A value whose type changed is one: 10 and "10" look alike on screen, but a program reads them differently, so the row names both types. A reordered array shows as changes at each position it occupies, because its items are compared by place. Text inside a string is compared exactly, so an extra space is a change.

When the input is not valid

A document that does not parse is not compared. The page names the side, Before or After, and the line and column of the first error. Text that is almost JSON can be cleaned up first with the Repair option of the JSON formatter.

Sending a document on

Send after to passes the After document to the JSON formatter, the validator, the TypeScript generator or the CSV converter. It travels in memory, with no file and no upload, and the tool you pick opens with it. For YAML or XML, open that converter, choose JSON → YAML or JSON → XML, and paste the document.

Questions

Short answers to what people ask most.

Does the order of keys change the result?

No. Keys are matched by name, so {"a":1,"b":2} and {"b":2,"a":1} have no differences. Array items are the exception: they are matched by position, so an array whose items moved shows a change at each position where the value differs.

Why is 10 a change when 10 and "10" look the same?

Because a program reads them differently: 10 is a number and "10" is text. A strict comparison treats them as different, so the row names both types, for example number to string.

Are indentation and line breaks ignored?

Yes. Both documents are parsed before they are compared, so spacing and line breaks never appear in the result. Text inside a string is compared exactly: a space added at the end of a value is a difference.

What happens with a very large document?

Both documents stay in the tab and nothing is uploaded. Above about 200,000 characters in total, the comparison runs in a Web Worker so the page keeps responding. The list shows the first 500 differences; Copy report returns all of them.

Is what I paste stored?

No. Both documents are kept in memory only, like the JWT decoder's token: a reload clears them, and nothing is written to sessionStorage. Nothing is sent to a server.