JSON Diff (Compare)

Enter JSON into A (left) and B (right) to compare added/removed/changed items as a tree or text. Nothing is sent to a server — everything runs in your browser.

A (original)
B (changed)

🔗 Share link encodes the A/B JSON you're comparing directly into the link itself (after the # in the address bar). It's never sent to a server, but anyone with the link can read its contents — don't share sensitive data this way.

How to use

  1. Input: Paste JSON into panel A (original) and B (changed), or open/drag a file into each.
  2. Compare: Click "Compare (Diff)", or the comparison runs automatically as you type.
  3. Check the result: "Tree view" colors added (green), removed (red), and changed (orange) items. "Text view" compares sorted JSON text line by line with +/-.
  4. Share: Click "🔗 Share link" to compress A/B into the URL and copy it to your clipboard. Opening that link reproduces the exact same comparison.
  5. Export: Copy the comparison result to your clipboard or download it as a file.

Everything runs inside your browser (JavaScript) — nothing you enter is sent to a server or stored. Arrays are compared by index (order).

When would you use JSON Diff?

Useful for checking how an API response changed across a deployment, reviewing changes to a config file, or comparing JSON data between two environments (production/development). Unlike text-based diff tools, it isn't thrown off by key order or indentation differences — it only surfaces changes that actually matter.

Frequently Asked Questions

Is my JSON data sent anywhere?

No. The comparison runs entirely in JavaScript inside your browser and is never sent to a server.

Does key order matter?

No, in tree view — objects are matched by key name, so order doesn't affect the comparison. Text view (Unified Diff), however, compares sorted text line by line, so a different order can show up as a difference there.

How are arrays compared?

Items at the same index are compared. If an item is inserted or removed in the middle of an array, everything after it shifts index and may show up as "changed" even if the value itself didn't change.

Can it compare very large JSON documents?

It works within your browser's memory limits, but tree rendering and text diff computation can get slow for very large JSON (tens of thousands of lines).

How is this different from git diff / text-based diff tools?

Text-based diff tools like git diff compare line by line, so even a change in key order or indentation shows up as a difference. This tool's tree view understands JSON's actual structure (keys and values), so purely cosmetic differences are ignored — only real value changes are surfaced.

Can I export the result as a JSON Patch (RFC 6902)?

Not currently. Instead, the copy/download feature gives you a JSON list of paths with their before/after values.

How does the share link work? Is anything stored on a server?

No. Clicking "Share link" gzip-compresses your A/B JSON and encodes it directly into the URL's # fragment. Fragments are never sent to a server by the browser, so nothing is stored anywhere — but that also means the link itself contains your raw data, and anyone who has the link can read it. Don't share a link generated from sensitive JSON.