JSON Diff Checker
Compare two JSON values structurally β added, removed, changed keys per nested path. Order-insensitive.
Why use this tool
05In-browser JSON diff tool. Walks both trees recursively, ignores object key order, surfaces type changes, counts each kind.
Paste two JSON values β a Left and a Right. The tool parses both, walks them recursively, and emits a structured diff: lines prefixed with + show keys/values only in the Right, lines prefixed with - show keys/values only in the Left, and unchanged content appears as-is. The output uses indentation to preserve the nested structure so you can see exactly where each change lives.
Unlike a line-based diff (which is what most diff tools do), this is a semantic diff: reordering object keys produces no diff (objects are unordered by spec), and pretty-printing differences are ignored. It compares what the JSON represents, not how it's formatted.
Arrays are diffed positionally by default: index 0 of Left vs index 0 of Right, etc. This matches how Git diffs JSON files β useful for change review on ordered data (history, time-series, sequence-sensitive lists). For semantic array diffing where elements should be matched by content rather than index, post-process with a manual review pass.
Counts of added / removed / changed / unchanged primitives are shown above the output so you can spot a small-but-impactful change in a sea of unchanged data. Everything runs in your browser; pair with JSON Formatter to clean up the inputs first, or Text Diff Checker for line-by-line comparison when the inputs aren't JSON.
How to use
03Quick checks before you copy
03Confirm the input is the format you intended.
Scan the result before using it in a document, URL, config, or message.
Copy only the output you need.
Use Cases
Capture a sample response before and after a backend change. Drop both in and immediately see which fields were added, removed, or changed β far faster than scanning two pretty-printed payloads side by side.
Paste prod's feature-flag JSON on one side and staging's on the other. The structural diff surfaces every divergence without false positives from key-order or formatting differences.
When debugging a state-management bug, capture the state object before and after the suspect action. The diff shows exactly which fields changed β useful for finding unexpected side effects.
Compare the original document against the post-patch result to confirm the patch did what you intended. Especially useful when the patch has many operations.
When migrating between schema versions, run the migration on a sample document and diff against expected output. Faster than writing assertion-by-assertion tests for ad-hoc changes.
Tips & Tricks
- 01Object diff is order-insensitive; array diff is positional
JSON objects are unordered by spec, so <code>{a:1,b:2}</code> equals <code>{b:2,a:1}</code> β no diff. JSON arrays are ordered, so <code>[1,2]</code> β <code>[2,1]</code> β diff. For order-insensitive array comparison (set semantics), this tool isn't the right fit β sort both arrays first and re-diff.
- 02Type changes count as 'changed'
If a value's type changes (e.g., <code>"42"</code> string to <code>42</code> number), it counts as one changed value. The diff line shows both the old and new representations so the type shift is visible.
- 03Counts represent leaf-level changes
Added / removed / changed counts measure primitive (leaf) operations, not whole-subtree changes. If you delete a nested object with 5 keys, you get 5 'removed' counts, not 1. This is the granularity most useful for understanding how impactful the diff is.
- 04Use the JSON Formatter first if inputs look unstructured
If your two inputs are minified or contain extraneous whitespace, paste through the JSON Formatter first. The diff itself ignores formatting, but pretty-printing first makes the diff output easier to read.
FAQ
07
Does this run entirely in my browser?
Yes. JSON.parse + recursive comparison + textual diff output β all pure JavaScript. Neither side's JSON is uploaded. Safe for production payloads, secret keys in configs, or any other sensitive content.
How is this different from the Text Diff Checker?
The Text Diff Checker compares two text blocks line-by-line β useful for diffing code or prose. The JSON Diff Checker parses both inputs as JSON and compares their STRUCTURE: reordered object keys produce no diff, pretty-printing differences are ignored, type changes are surfaced explicitly. Use line diff for code, structural diff for JSON.
Does it support deep arrays of objects?
Yes β the diff recurses into nested arrays and objects without depth limits. Arrays are compared positionally (element 0 vs element 0, etc.). For arrays where you want to match by content (e.g., 'find me the elements unique to each side regardless of position'), this tool is not the right fit β you'd need a tool that supports id-based array diffing.
What if my inputs aren't valid JSON?
The tool surfaces the parse error inline for whichever side failed. Fix the JSON (often a trailing comma, single-quoted string, or unquoted key) and the diff updates live. For pretty-printing and validating, our JSON Formatter is the sibling tool.
How are added/removed/changed counted differently from 'unchanged'?
Each primitive (leaf) value contributes one count: 'added' for keys only on the Right, 'removed' for keys only on the Left, 'changed' for keys present on both with different values, 'unchanged' for keys present on both with identical values. Whole-object additions/removals add up across all their leaf primitives.
Can I diff two JSON arrays at the top level?
Yes. Top-level arrays are diffed positionally β element 0 on Left vs element 0 on Right, etc. If lengths differ, extra elements are shown as additions or removals.
Does the tool work for very large JSON files?
Performance depends on input size and depth. Hundreds of kilobytes are fast; multi-megabyte deep-nested JSON may take a moment. For huge inputs, use a CLI tool like <code>jd</code>, <code>jsondiffpatch</code>, or <code>diff <(jq -S . a.json) <(jq -S . b.json)</code> which can stream and avoid loading both into browser memory.
Related tools
03JSON Formatterβ
Format, minify, and validate JSON in one place.
JSON to TypeScript Typesβ
Generate TypeScript interfaces from a JSON sample β nested types, arrays, optional keys inferred.
Text Diff Checker β Line, Word & Characterβ
Compare two text blocks and see additions, deletions, and changes β switchable between line, word, and character granularity.