JSON Diff

Max 512 KB per side · Compares automatically as you type

Processed entirely in your browser — nothing is sent to a server.

Comparing two JSON documents by eye — scrolling between two long, similarly-shaped blocks of text looking for the one field that changed — is slow and error-prone. This tool does it structurally: paste the original on the left and the updated version on the right, and it shows exactly which keys were added, removed, or changed, with capture groups for arrays broken out precisely from cosmetic reordering.

This is a structural diff, not a text diff. The distinction matters: a text diff compares characters and lines, so reindenting a file or reordering its keys would show up as changes even though nothing about the data actually changed. This tool parses both sides into real JSON values first and compares the DATA — key order and whitespace are never meaningful in JSON to begin with, so two documents that only differ in formatting show zero differences.

Arrays get special handling. Comparing arrays index-by-index would report every element as “changed” the moment one element near the start moves, even if nothing about the array’s actual contents changed — just their positions. This tool instead matches array elements that are genuinely identical between the two sides (the same technique behind most line-based diff tools), so a pure reorder shows only what actually needs to move, not everything downstream of it. The one honest limitation: an element that changed slightly, rather than moved, isn’t matched to its former self — it shows as an old one removed and a new one added at that position, since deciding two different-but-similar objects “are” the same logical record would need a much more speculative kind of matching. See the FAQ for the full story.

Nothing leaves your browser. Parsing and diffing both run entirely client-side. A comparison in progress is saved to your browser’s own local storage as a convenience — so an accidental reload doesn’t lose your work — and restored visibly (never silently) the next time you open the tool, with a clear option to discard it.

Large arrays get a Web Worker, not the main thread — diffing a big array with many differences is the one case on this tool genuinely worth the overhead of moving off the page’s own thread, so it doesn’t lock up the tab while comparing.

Examples

Frequently asked questions

Does reordering keys or reformatting count as a difference?
No. This is a structural diff, not a text diff — it compares the parsed data, not the raw characters. Two JSON documents with the same keys and values in a different order, or with different whitespace/indentation entirely, show zero differences, since JSON object semantics don't consider key order or formatting meaningful in the first place. Only actual data differences — a value that changed, a key that was added or removed — show up.
How does this tell an array reorder apart from real changes?
By matching elements between the two arrays wherever they're truly identical, using the same longest-common-subsequence technique behind most line-based diff tools, before deciding what's added or removed. Reordering existing elements produces at most a small removed/added pair for whatever had to move past something else — never one 'changed' entry per element, which is what a naive index-by-index comparison would show. See the next question for the one real limitation this leaves.
Why does changing one field of one object in an array show as remove+add instead of 'changed'?
Because this tool matches array elements by exact equality, not by similarity. If you change {'{'}"id":1,"name":"A"{'}'} to {'{'}"id":1,"name":"B"{'}'} inside an array, the two objects are no longer identical, so they're not matched to each other — the tool reports the old one removed and the new one added at that position, rather than guessing that they represent the same logical record with one field changed. Detecting that would require matching objects by something like a shared id field, which is a real, more speculative feature this tool doesn't attempt. If this matters for your data, compare the two objects directly rather than the arrays that contain them.
Is my JSON saved anywhere?
Only in your own browser's local storage, as a convenience so a comparison in progress survives an accidental tab close or reload — nothing is ever sent to a server. On your next visit, if a saved session exists, both fields are restored and a visible "Restored your previous session" notice appears with a Discard option; it's never applied silently. Clearing both fields, or clicking Discard, removes the saved copy.
Can I navigate a large diff without scrolling through everything?
Yes — the Prev/Next buttons above the difference list step through every difference one at a time, scrolling each into view and announcing its position (e.g. "Diff 4 of 19") to screen readers as you go. Each entry in the list is also marked with a symbol (+, −, or ~) in addition to its color, so the three states — added, removed, changed — are distinguishable even without color vision.