JSON Diff
Compare two JSON documents and see a structural diff of what was added, removed and changed — entirely in your browser.
Both JSON documents are parsed and diffed locally in your browser and never uploaded, but avoid pasting secrets or production credentials into any online tool.
Need to reshape the result? Try the JSON Formatter.
About JSON Diff
JSON Diff compares two JSON documents and shows a structural diff instead of a line-by-line text diff. Paste your original JSON on the left and the changed version on the right, and it parses both and reports exactly which values were added, removed, changed, or had their type altered — each with a path like user.roles[2]. Because the comparison is semantic, reordering object keys never shows up as a difference, so you only see changes that actually matter. Turn on Ignore array order to compare arrays as sets, or Sort keys to normalize both sides in the side-by-side view. It is built for developers diffing API responses, config files, and fixtures. Everything runs locally in your browser, so the JSON you paste is never uploaded and stays on your device.
Features
- Semantic, key-order-independent diff — reordered object keys are not flagged as changes
- Reports added, removed, changed, and type-changed values, each with a path like user.roles[2]
- Distinguishes a real type change (1 vs "1", null vs a value) from an ordinary value change
- Summary counts show how many entries were added, removed, and changed at a glance
- Ignore array order option compares arrays as multisets of values instead of by position
- Sort keys normalization for a clean side-by-side comparison of both formatted documents
- Side-by-side syntax-highlighted view of both pretty-printed JSON documents
- Copy the whole diff as a plain-text summary, or clear both inputs in one click
How to use the JSON Diff
- Paste the original JSON into the Original box on the left.
- Paste the updated JSON into the Changed box on the right.
- Read the colored diff: green for added, red for removed, amber for changed values.
- Toggle Ignore array order or Sort keys if order should not count as a difference.
- Switch to Side by side to compare both formatted documents, or copy the diff summary.
Example
Input
// Original
{ "name": "Ada", "roles": ["admin"], "active": 1 }
// Changed
{ "active": "1", "name": "Ada", "roles": ["admin", "editor"] }
Output
+ roles[1]: "editor"
~ active: 1 → "1" (type changed)
Reordered keys are ignored; a new array item is added and active flips from number to string.
Common errors & troubleshooting
- The tool shows "Invalid JSON on the left side" or the right side. — Fix the flagged document — the error names which side failed and why. Each input must be a complete, valid JSON value (object, array, string, number, true/false, or null).
- Reordering the elements of an array shows up as many changed entries. — Turn on Ignore array order so arrays are compared as sets of values; without it, arrays are compared by position and a reorder counts as changes.
- 1 and "1" are reported as different even though they look the same. — That is a type change: the left value is a number and the right is a string. JSON Diff intentionally separates type changes from value changes so they are easy to spot.
- Two objects with the same keys in a different order are reported as changed. — They should not be — the diff is key-order-independent. If you see this, one side likely has an extra or missing key, or a value differs; check the reported path.
Frequently asked questions
- Does JSON Diff ignore the order of object keys?
- Yes. The comparison is semantic, so two objects with the same keys and values are equal regardless of key order. Only real additions, removals, and value changes are reported, each with its path.
- How does JSON Diff handle arrays in a different order?
- By default arrays are compared by position, so reordering elements shows up as changes. Turn on Ignore array order to compare arrays as multisets, where only genuinely added or removed members are flagged.
- Why are 1 and "1" shown as different?
- Because their JSON types differ — one is a number and the other a string. JSON Diff labels this a type change, separate from an ordinary value change, so you can catch accidental stringified numbers in API responses.
- What does a path like user.roles[2] mean in the diff?
- It points to the exact location of the change: the key user, then its roles array, then the element at index 2. Object keys use dots and array elements use bracketed indices.
- Can I compare deeply nested JSON and nested arrays?
- Yes. JSON Diff walks both documents recursively through nested objects and arrays of any depth, reporting each change at its full path so large, deeply nested payloads stay readable.
- Is the JSON I paste into JSON Diff uploaded anywhere?
- No. Both documents are parsed and compared entirely in your browser, so the JSON you paste — including any sensitive fields — stays on your device and is never sent to a server.
Related tools
- Text Diff — Compare two texts line-by-line and see additions and removals.
- JSON Formatter — Beautify, minify and validate JSON with error locations.
- JSON Viewer — Text + collapsible tree viewer with expand/collapse and node paths.
- JSON Tree Viewer — Explore JSON as a collapsible, typed tree.
- YAML ↔ JSON — Convert YAML to JSON and back.
- JSON Escape / Unescape — Escape text into a JSON string or unescape a JSON string back to raw text.
- Compare PDFs — Diff the extracted text of two PDFs line-by-line.
- JSON to CSV — Convert an array of flat JSON objects to CSV.
All ArrayKit tools