JSON Diff
Compare two JSON objects and find differences instantly
JSON 1
JSON 2
Differences
What is JSON Diff?
Two API responses look almost identical, but something changed and broke production. Or you're staring at a config file that worked yesterday and doesn't today. JSON Diff does the thing that's painfully slow by eye: it walks both objects key-by-key and shows you exactly what's added, what's removed, and what's been modified — line for line.
Because the comparison is structural (not just textual), key order and whitespace don't trip it up. A reformatted file with the same data shows zero differences. A renamed field shows up as one removal and one addition. That's the same approach RFC 6902 takes for JSON Patch, the official spec for describing JSON changes. To brush up on the underlying format itself, the official JSON specification or RFC 8259 are both good references. And when your inputs aren't strictly JSON — log snippets, partially-encoded payloads, or mixed text — a general-purpose text comparison tool covers that side of the workflow.
How to Use JSON Diff
- Paste the Original JSON – Drop your "before" version into the left panel. This is the baseline you're comparing against.
- Paste the Updated JSON – Drop the "after" version into the right panel. The order matters: differences are reported relative to the original.
- Review the Diff Output – The bottom panel highlights every change. Removed lines are marked in red, added lines in green, and modified values show both old and new side-by-side.
- Use the Sample Data – Click "Sample" on the left panel to load a small worked example so you can see how the tool behaves before pasting your own data.
- Ignore Cosmetic Noise – Because the comparison is structural, you don't need to re-format either side. Minified vs. pretty-printed JSON with the same data will compare as identical.
Pro Tip: If you only care about which keys changed (not the values), focus on the section headings in the diff — they show the JSON path to every changed leaf.
Example
Two versions of the same subscriber profile — the plan changed, roaming was enabled, and signal strength dropped. The diff highlights only what moved.
{
"msisdn": "447700900142",
"plan": "Pay As You Go",
"roaming": false,
"rsrp": -88,
"updatedAt": "2026-05-12"
}{
"msisdn": "447700900142",
"plan": "Unlimited 5G",
"roaming": true,
"rsrp": -104,
"updatedAt": "2026-06-24"
}Common Use Cases
API Version Regression Testing
You bumped an API from v1 to v2 and want to confirm nothing important changed in the response shape. Paste yesterday's response on the left and today's on the right — anything that shifted (a renamed field, a new optional property, a removed enum value) shows up immediately. This is the cheapest contract-testing pass you'll ever run.
Configuration Drift Detection
Two environments — staging and production — are supposed to share the same config but something is behaving differently. Export both configs, diff them here, and the offending key jumps out. Combined with a JSON validator sweep, this catches the majority of "works on my machine" issues before they reach an incident review.
Audit and Compliance Trails
Many compliance frameworks require you to show before/after state when sensitive records change. Use the diff to produce a human-readable summary of which fields moved between two snapshots — useful evidence to attach to a change request or audit log. For the formal change-description format, the JSON Patch RFC is worth bookmarking.
Key Features
- Structural Comparison – Ignores cosmetic differences (whitespace, key order, indentation) and compares the actual data.
- Added / Removed / Modified Highlighting – Color-coded output so you can scan a diff in seconds.
- Handles Nested Structures – Deep objects and arrays are walked recursively; changes are reported with their full JSON path.
- No Server Round-Trip – Comparison happens entirely in your browser; neither side is ever uploaded.
- Sample Loader – Pre-loaded example so you can see the output shape before pasting real data.
Frequently Asked Questions
Does key order in objects affect the diff?
No. JSON objects are unordered by definition (see RFC 8259 §4). The tool compares by key name, so two objects with the same data in a different order produce zero differences.
What about array order?
Arrays are ordered, so position matters. ["a", "b"] and ["b", "a"] show up as different. If you want order-insensitive array comparison, sort both arrays before pasting — or use a structural diff library like jsondiffpatch in code.
Can I compare large JSON files?
Yes. The tool comfortably handles files up to a few megabytes. Past that, the diff itself is still fast, but rendering thousands of changed lines in the browser can feel laggy — try narrowing your input to the object subtree you actually care about.
Is my data safe?
Yes. Comparison runs entirely client-side in your browser. Neither JSON blob is sent to any server, nothing is cached, and nothing is logged. If privacy is critical, you can also disconnect from the network and the tool will keep working — try it.
My JSON has trailing commas / single quotes — will it still diff?
Both sides must be valid JSON first. If parsing fails on either side, the diff doesn't run. Run each side through a JSON Validator to identify the syntax issue, then come back. For a list of common JSON gotchas, the MDN JSON documentation is a fast read.
Related Tools
- JSON Formatter – Pretty-print both sides before diffing if you want consistent indentation.
- JSON Validator – Catch syntax errors before they break the diff.
- JSON to Table – View either version as a sortable table to scan rows quickly.
- JSON Minifier – Strip whitespace if you want to compare raw byte size, not structure.
Useful Resources
- RFC 8259 – The current IETF spec for JSON; defines object equality and array ordering rules.
- RFC 6902 — JSON Patch – Standard format for representing differences between two JSON documents.
- JSON.org – Original JSON spec with railroad diagrams of the grammar.
- MDN JSON Guide – Reference for parsing and serialising JSON in JavaScript.
- jsondiffpatch – Open-source JS library that powers many web-based JSON diff tools, including support for array-move detection.
- Stack Overflow JSON Tag – Community Q&A for tricky JSON edge cases and language-specific parsing.