Comparing
How to compare two JSON files
Diffing JSON as plain text drowns you in false changes — reordered keys and reformatting look like edits when nothing really changed. A structural diff compares the data itself. Here's the difference and how to do it.
Updated July 20264 min read
Text diff vs. structural diff
A normal text diff (like git diff) compares files line by line. For JSON that's a problem, because two files can hold identical data yet look completely different as text. Consider these two objects:
// A
{ "id": 1, "name": "Ada" }
// B
{
"name": "Ada",
"id": 1
}A line-based diff screams that almost every line changed. But the data is the same — only the key order and formatting differ. That's noise.
A structural diff parses both sides into their real structure and compares node by node. It matches objects by key and arrays by index, so it reports only genuine changes: values that were updated, keys that were added or removed, and elements that shifted in an array.
How to compare two JSON documents
Using the JSON Diff tool:
- Paste the original document into the left panel.
- Paste the changed document into the right panel.
- Read the result: additions, removals, and updates are highlighted and grouped by path, with a running count of each.
- Toggle Hide unchanged to focus only on what moved, or Swap sides to flip which document is the baseline.
Both documents are validated as you paste, so if one side isn't valid JSON you'll know immediately rather than getting a misleading diff.
Reading a JSON diff
Changes are reported against the path to each value. For example:
limits.requests:1000 → 5000— an updated value.limits.window: added — a key that only exists in the new version.regions[1]:"eu-west" → "ap-south"— an element that changed at a specific array index.
Paths make it easy to describe a change precisely in a review or bug report, instead of pointing at line numbers that shift whenever the file is reformatted.
Common reasons to diff JSON
- Reviewing changes between two API responses or two versions of a config file.
- Debugging why staging and production return different payloads for the same request.
- Auditing an edit to a large document to confirm only the intended fields changed.
- Comparing exported data — feature flags, translations, fixtures — to catch drift.
A note on arrays
Arrays are compared by index, so inserting an item near the top can make everything after it look "changed" — each element shifted by one position. If you care about set membership rather than order, sort both arrays consistently before comparing, or compare the objects by a stable id. For most config and API payloads, index-based comparison is exactly what you want.
Frequently asked questions
How do I compare two JSON files?
Paste the original into one panel and the changed version into the other. A structural diff walks both documents and reports every added, removed, and updated value by its path.
Does reordering keys count as a change?
No. A structural JSON diff matches objects by key, not by position, so reordering keys produces no differences. Only real value changes are reported.
Can I compare JSON that is formatted differently?
Yes. Because the comparison is structural rather than line-by-line, different indentation or whitespace never shows up as a change.
Is my data uploaded when comparing?
No. With JSON-Table the diff runs entirely in your browser, so you can safely compare private or sensitive documents.