RunTheTests
/

JSON Compare / Diff

Diff two JSON documents structurally instead of by text.

What you paste

Parsed in your browser — never uploaded

How this reads your output

Both documents are parsed and walked together, comparing values at each path rather than comparing text. Key order and formatting are ignored entirely, which is what makes this different from a text diff: two documents that a line-based diff shows as completely different can be structurally identical. Type changes are reported as their own category because they break consumers in a way that a value change usually does not.

What the results mean

Type changes
A field that changed shape, such as a number becoming a string or an object becoming an array. The most likely difference to break something downstream.
Added and missing
Keys present in one document and not the other. Read the path to see where in the structure it sits.
Values changed
The same path holding a different value. Ordinary drift, and usually the least concerning category.

Common problems and fixes

Everything after one array element reports as changed
An element was inserted or removed, and positional comparison shifts everything after it. If the array holds objects with a stable identifier, sorting both documents by that identifier before comparing gives a far more readable result.
Two responses look identical but report differences
Look for a timestamp, a request identifier or a generated token, which differ on every response by design. Those are the usual noise in an API comparison, and removing them from both documents before pasting makes the real differences visible.

Frequently asked questions

How is this different from a text diff?

A text diff compares lines, so reordering keys or reformatting whitespace shows as a large change even though nothing meaningful moved. This compares values at each path, so only genuine differences appear. For reviewing an API response between two versions, that distinction is the whole point.

What does the path notation mean?

It reads from the root: $.user.address.city is the city inside address inside user, and $.items[2].id is the identifier of the third element of items. It matches the notation most JSON query tools use.

Does key order ever matter in JSON?

Not according to the specification, and no consumer should depend on it. It matters in exactly one place: computing a hash or a signature over the serialised text, where a canonical ordering has to be agreed in advance.

Put this on your own site

Free to embed, no attribution required beyond the source link the frame carries itself. It runs entirely in your visitor's browser, sets no cookies and loads no third-party script.

Embed code
<iframe src="https://runthetests.com/embed/json-compare/" width="100%" height="720" style="border:1px solid #e5e5e5;border-radius:8px" title="JSON Compare / Diff" loading="lazy"></iframe>

Preview it at https://runthetests.com/embed/json-compare/. Embedded pages are marked noindex, so yours stays the canonical copy — not this one.

More in DevTools