Skip to main content

Data Tools

JSON Diff

Compare two JSON files and find differences. Free online tool — runs in your browser, no sign-up required.

See how to use this tool

JSON Diff

Data is converted locally in your browser without server upload.

Privacy: your input is processed only in this browser. Refreshing clears the current state.

About JSON Diff

JSON Diff computes a structural delta between two JSON documents using a recursive deep-compare algorithm rather than a naive line-by-line text diff. That distinction matters: text diff sees reordered object keys as a change, while structural diff recognizes that {"b":1,"a":2} and {"a":2,"b":1} are semantically identical. The comparator walks both trees in parallel, classifies each node as added, removed, modified, or unchanged, and reports the exact JSON path (e.g. users[3].email) where values diverge.

The engine handles arrays with a longest-common-subsequence matcher, so inserting one element at the top of a 1000-item list does not produce 1000 fake 'modified' entries — only the genuinely new item is flagged. For objects with a natural identity (an id field), you can switch to key-based alignment so that reordering items in an array is treated as a no-op.

Everything runs locally in your browser. Two config snapshots, two API responses, or two production payloads never leave your machine, which is essential when the documents contain credentials, customer records, or internal schema details you cannot paste into an external diff service.

How to use it

  1. 1Paste the original JSON into the left editor and the changed JSON into the right one.
  2. 2Choose array alignment: index-based (default) or key-based (uses an id-like field).
  3. 3Toggle 'Ignore key order' to treat objects with reordered keys as equal.
  4. 4Toggle 'Ignore whitespace in strings' if formatting noise should not count as a change.
  5. 5Read the unified diff view — added paths, removed paths, and modified paths are color-coded with the exact JSON path.

When to use it

  • ✓Spotting exactly which fields changed between two versions of an OpenAPI spec.
  • ✓Comparing two API responses to debug a regression that only appears in staging.
  • ✓Reviewing a Terraform plan JSON before and after a refactor to confirm no unintended drift.
  • ✓Auditing config deltas between two environments (dev vs prod) for security-sensitive keys.

Features

  • •Recursive structural compare with JSON-path-precise change reporting.
  • •LCS-based array alignment so insertions and deletions don't cascade into false edits.
  • •Optional key-order and string-whitespace ignoring for semantically meaningful diffs.
  • •100% local — both documents stay in your browser, nothing is uploaded.

Related tools

FAQ

Why does JSON Diff show no changes when git diff shows a huge diff?

Git does a line-based text diff, so reordered object keys or reformatted whitespace look like many changes. JSON Diff compares the parsed structure, so semantically identical documents with different key order or indentation report as equal.

How are arrays with reordered elements compared?

By default with index-based alignment, so a reordered element shows as a modification at that index. Switch to key-based alignment and point it at an id-like field, and reordering becomes a no-op — only genuinely added or removed items are flagged.

Is my data sent anywhere?

No. Both JSON documents are parsed and compared entirely in your browser. There is no network call, so it is safe for payloads containing tokens, PII, or internal schema.

What happens with very large or deeply nested JSON?

Files up to about 10 MB compare in a few seconds. The recursive walker has linear cost in node count, but deeply nested structures (thousands of levels) can hit the browser's call-stack limit — flatten or split the document in that case.

Does it handle JSON with comments (JSONC) or JSON5?

No. The comparator targets standard RFC 8259 JSON. Comments and unquoted keys will fail parsing on that side — strip them first with the JSON Formatter & Validator if needed.

Can I export the diff?

Yes. You can copy a JSON patch (RFC 6902 style add/remove/replace operations) or download an HTML side-by-side report for sharing in a bug ticket.