JSON Diff

Compare two JSON documents and see exactly which paths were added, removed or changed.

Runs on your deviceDeveloperWorkingNo account needed

What this tool does

JSON Diff parses both documents and then walks them together, matching objects key by key and arrays index by index. What comes back is not a line-by-line text comparison but a flat list of paths: every key present on one side only, and every value whose contents differ — a single leaf, or a whole branch where one side holds an object and the other an array. Each row names the location in dot and bracket notation — meta.owner, tags[2] — alongside the value held on each side, and the summary counts how many were added, removed and changed.

Because the walk is by key rather than by position, key order is irrelevant: the same object written with its fields in a different sequence yields no differences at all. That is deliberate, and it is why there is no sort-keys switch on this page — there would be nothing for it to change. Reindenting, minifying or rewrapping a document has the same non-effect. When those cosmetic edits are what you need to see, compare JSON as plain text with Text Diff; this tool answers only questions about structure and values.

Arrays are matched by index, and that is the limitation worth knowing before you trust the output. Insert one element at the front of a long list and every position after it shifts, so the result reports a change at each index plus a single addition at the end, rather than the one insertion you actually made. There is no move detection and no matching on an id field. Displayed values are abbreviated as well: anything beyond roughly 120 characters is cut with an ellipsis in the First and Second columns, so a long string is reported as changed without the whole of it being shown, and nothing inside a value is highlighted — the two versions sit side by side rather than marked up character by character.

A second gap comes from the browser's own number handling, which reads JSON numbers as 64-bit floats. Integers past about 9,007,199,254,740,992 — long database identifiers, timestamps counted in nanoseconds — are rounded as they are read, so two documents differing only in those final digits arrive as the same value and are reported as identical. The rest is straightforward: both documents are parsed and compared inside this browser tab, nothing is uploaded, and payloads carrying access tokens or customer records stay where you pasted them.

How to use it

  1. Paste the first document. Drop it into the input box, or press Load sample to see a pair that already differs in a few places.
  2. Supply the second document. Paste it into the Second document box. Leave that box empty and the input is split instead at the first line equal to the separator, which is --- until you change it.
  3. Read the change list. The result is a table of Change, Path, First and Second with one row per difference, and Copy output hands those four columns back as CSV. When nothing differs the table comes back empty and the summary line underneath reads Identical — no differences found.

Processing & privacy

Runs on your device. Your file is processed directly in this browser.

Common use cases

Comparing config across two environments

Staging and production settings drift apart quietly. A path list shows which keys were added or retuned, with none of the noise that differing indentation would add.

Checking what an API changed between versions

Capture a response before and after a deploy, and the comparison names the fields that appeared, vanished, or changed from a string to a number.

Verifying an export round-trip

Convert a document out to another format and back, then compare it against the original. Read the identical verdict for what it is: a match on structure and values, after the parser has already resolved key order, repeated keys and oversized integers.

Reviewing a feature flag or translation file

Long flat objects are painful to scan by eye. The object diff reduces a four-hundred-key file to the handful of entries that actually moved.

Questions

Are my documents uploaded?
No. Both are parsed and compared inside this tab by the browser itself. Nothing is transmitted anywhere, which is why the comparison still runs with the network disconnected.
Does key order count as a difference?
No. Objects are matched by key name, so reordering fields changes nothing in the result. Two documents listing the same pairs in a different sequence are reported as identical.
Why are two visibly different files reported as identical?
Only structure and values are examined, so whitespace, indentation, key order and the choice between minified and pretty-printed text are invisible here. Two parser-level causes have the same effect: an integer above roughly nine quadrillion is rounded to the nearest 64-bit float, and a repeated key keeps only its last occurrence, so a document declaring the same key twice matches one that declares it once.
How are arrays compared?
Strictly by index — position 0 against position 0, and so on. An element inserted or deleted in the middle shifts everything after it, and the output shows that as a run of changes rather than as one insertion.
Can I apply the result as a patch?
No. The output is a readable list of paths with the value from each side, not an RFC 6902 JSON Patch or a unified diff, so it is meant for a person to read rather than for a program to apply.
What happens if one document will not parse?
The comparison stops and the parser error is shown with the line and column where it failed, though the message does not say which of the two documents it came from. Both sides must be strict JSON, so a trailing comma or a comment has to be fixed before anything can be compared.

Related tools