Skip to content
ToolZone

JSON Diff

Compare two JSON objects and highlight exactly what was added, removed, or changed between them, useful for reviewing API responses or configs.

Runs in your browser. Nothing you enter or upload leaves your device.

Original
Modified
Differences
Paste text in both boxes to compare

Both sides are parsed and pretty-printed with keys sorted, so only real data changes show up.

Keyboard shortcuts

Run the main action
⌘ / Ctrl + Enter
Copy the result
⌘ / Ctrl + Shift + Enter
Download the result
⌘ / Ctrl + S
Paste a file or image into file tools
⌘ / Ctrl + V
Search all tools
⌘ / Ctrl + K
Show these shortcuts
?

You can also drop files anywhere on the page.

About the JSON Diff

When an API response changes or a config file drifts, you want to see exactly what is different. This JSON diff tool puts two documents side by side and compares them line by line, marking lines that were removed from the original in red and lines that appear in the modified version in green.

How it works

Both inputs are parsed as JSON. Each document is pretty-printed with two-space indentation and its object keys sorted alphabetically at every level, so minified and formatted versions, or the same keys in a different order, produce identical text.

The normalized documents are then compared with the same line-alignment algorithm as the Text Diff tool, and the changed words are highlighted. If either side isn't valid JSON, the parse error is shown instead.

How to use

  1. 1

    Paste or open the older JSON in Original.

  2. 2

    Paste or open the newer JSON in Modified.

  3. 3

    Read the differences: removed lines in red, added lines in green, changed values highlighted.

  4. 4

    Use Only changes to focus on what differs in large documents.

Worked examples

Changed value

A version number changed in package metadata.

Input
Original line 3: "version": "1.2.0", Modified line 3: "version": "1.3.0",
Result
- "version": "1.2.0", + "version": "1.3.0",

All other lines are shown unchanged.

Inserted key

A new key was added near the top of an object.

Input
Modified has an extra line after line 2
Result
Every line from 3 onward is marked as removed and added

Because lines are compared by position, an insertion shifts the rest of the file. Add new keys at the end, or compare smaller sections, to keep the result readable.

Limitations
Array items are compared in order; reordered arrays show as changes. No JSON path is shown for a change; you read it from the surrounding lines. Very large documents may fall back to a simpler line comparison to stay fast.
Assumptions
Both documents are formatted the same way. Lines correspond to each other by position.
Privacy
Both documents are compared in your browser and are not uploaded or stored.

Frequently asked questions

Does key order matter when comparing JSON?+

No. Keys are sorted at every level before comparing, so the same data with keys in a different order shows no differences.

Can this compare deeply nested JSON structures?+

Yes. Both documents are pretty-printed one key per line, so a change deep inside is shown on its own line with its parent keys around it.

Will one change mark the rest of the document as changed?+

It shouldn't be. Lines are aligned by content, and both sides are normalized first, so only real data changes show up.

Does it validate my JSON?+

Yes. Both sides are parsed first, and if either isn't valid JSON the error is shown instead of a diff.

Is my data sent to a server?+

No. The comparison runs entirely in your browser.

Related tools