JSON Diff & Compare

Paste two JSON documents to compare them structurally after parsing — a JSON Compare that treats reordered keys and whitespace as zero differences. Added, removed and changed paths are listed in dot notation with old and new values. Both documents stay in the browser tab; nothing is uploaded.

Press CompareKey order and formatting are ignored

Runs in this tab · nothing is uploaded · Verify in 10 seconds →

What the JSON Diff & Compare does

A structural JSON diff compares two documents after parsing them, so it reports what actually changed (added, removed and changed values) instead of every reordered key or reformatted line. Use it to compare API responses, config revisions or database exports where a text diff drowns you in noise.

How the JSON Diff & Compare works

Both panes are parsed with your browser's JSON.parse, then the two values are walked recursively. Object keys are matched by name, array items by index, and each difference is reported with its dot-notation path (like user.roles[1]) and the old and new value. Because the comparison happens on parsed values, key order, indentation and whitespace produce zero differences. Everything runs locally in this tab.

~/faq

Frequently asked questions

Why does this show no differences when the files look different?

Because the documents are structurally identical. RFC 8259 defines a JSON object as an unordered collection of members, so two files with the same data in a different key order or with different indentation parse to the same value, which is exactly what this tool compares.

How are array changes reported?

Array items are compared by position: item 0 against item 0, item 1 against item 1, and so on. Extra items at the end of one side show as added or removed. An item inserted at the front therefore shows as a change at every following index, the tool does not detect moves.

What does the path notation mean?

Paths use dot notation for object keys and bracket indexes for arrays: user.roles[1] is the second element of the roles array inside user. Keys that are not valid identifiers are quoted in brackets, like ["content-type"].

Is 1 different from 1.0 or "1"?

1 and 1.0 are equal, JSON.parse turns both into the same number. "1" (a string) is different from 1 (a number) and is reported as a change, because the type differs even though the text looks similar.

Is my JSON uploaded to compare it?

No. Parsing and comparison run entirely in this tab. LocalFirstTools has no server endpoint that receives the documents you paste.