Skip to content

JSON Diff

Compare two JSON documents structurally, so a difference in key order or indentation is not reported as a change.

A

B

Enter something above to see the result.

Comparing structure, not text

Two JSON documents that differ only in key order or indentation are identical as data. A text diff reports every one of those lines; this reports nothing, because nothing changed.

Each difference is shown by its path — `user.roles[2]`, `meta.total` — which is the form you can paste into a jq filter or a test assertion.

Frequently asked questions

Why is a reordered array reported as changed?

Because order is meaningful in a JSON array. Objects are compared by key and arrays by index, which matches how the data is actually read.

Can I compare two API responses?

That is the usual reason to use it. Both stay in the browser, so comparing responses that contain tokens or customer data is safe.

Related tools