JSON Diff

Compare two JSON documents and see exactly what changed — side-by-side, unified, tree, and RFC 6902 patch views, with merge, statistics, and export, all local to your browser.

Loading tool…

Why comparing JSON needs more than a text diff

A plain text diff compares lines. JSON does not care about lines — or about key order, or indentation, or whether a document is minified. Two payloads that are semantically identical can produce a diff full of changes, while a single meaningful value change can hide inside a reformatted block. The comparison you actually want is structural.

A JSON diff parses both documents into data structures and walks them together, reporting differences by path: which keys were added, which were removed, which values changed and from what to what. Arrays are the tricky part, since an element inserted at the front shifts everything after it. The result is a list of real changes rather than a wall of reformatting noise.

Why we built this tool

The everyday uses are debugging ones: comparing a staging API response against production, checking what a deployment changed in a config, diffing a mocked fixture against live output, or working out why one environment behaves differently from another.

Both sides of that comparison are usually real payloads, complete with customer data, tokens, and internal identifiers. Pasting two production responses into an online diff service means handing over twice as much sensitive data as usual. Ours parses and compares both documents in your browser, using your CPU, with no request leaving the page. Nothing is uploaded, nothing is retained, and there is no size limit beyond what your own memory allows.

Tips and common mistakes

  • Sort arrays on both sides first when order is not meaningful, otherwise a reordering reads as a wholesale change.
  • Redact tokens and personal data before pasting payloads into a shared bug report.
  • Timestamps and request identifiers will always differ between two captures — expect them in the results and ignore them.
  • If one side will not parse, validate it separately before assuming the diff is wrong.

Open JSON Diff with a link

JSON Diff can be handed its input by the link that opens it, so the page arrives with the work already done. This is meant for assistants and scripts: if a chatbot, an editor extension, or a command-line agent already holds your content, it can build a link instead of asking you to copy and paste into a box.

The payload rides in the fragment — the part of a URL after the #. Browsers never send the fragment to a server, so anything handed over this way stays on your device exactly as a dropped file would. A link that uses the query string instead is rewritten into the fragment by the page before any analytics or ad script can read the address.

Prefix any field with gz#gza= — to pass it as gzip-compressed base64url, which fits roughly five to ten times more into the same link. Links stay reliable up to about 8,000 characters; past that, chat apps and address bars start truncating them, and the page says so rather than loading half a document.

One exception to the privacy rule: ?url= tells the page to download the input from an address. That request goes from your browser straight to that server — not through ours — but it does leave your device, and it only works if the server allows cross-origin requests.

  • #a= — the first side to compare
  • #b= — the second side to compare

Example: https://mygadgets.ink/tools/json-diff/#a=...&b=...

Quick start: using JSON Diff

  1. Paste the first JSON document into the left input.
  2. Paste the second into the right input.
  3. Run the comparison to see the structural differences.
  4. Read the results by path — added, removed, and changed keys are reported separately.
  5. Copy the diff output if you need to attach it to a bug report.

If either side will not parse, run it through JSON Validator first. For line-based comparison of ordinary text, use Diff Checker.

Related Developer Tools

Browse all Developer Tools →