JSON Diff

Runs 100% in your browser

Compare two JSON documents locally with path-aware added, removed, and changed reporting for nested objects, arrays, and primitives — both inputs stay in your browser.

DOCUMENT A

Original JSON

Not checked
0 bytes Document A
DOCUMENT B

Changed JSON

Not checked
0 bytes Document B
Added
Removed
Changed
Unchanged
ResultWaiting
DIFF REPORT

Path-aware changes

Compare two valid JSON documents to begin.
ChangePathValue in AValue in B

Your added, removed, and changed paths will appear here.

Frequently asked questions

JSON Diff compares two valid JSON documents and reports exactly which paths were added, removed, or changed. It compares structure and values recursively, so changes deep inside nested objects and arrays are found and reported with their full JSONPath.

Paste the original document into Document A and the changed document into Document B, or open local JSON files using the file buttons. Click Compare to generate the path-aware diff report. Both documents must be valid JSON before comparison begins.

Yes. Nested property changes are reported with full JSONPath notation such as $.user.name or $.settings.theme, making it easy to locate exactly which nested field changed without reading the entire document.

Yes. Array elements are compared at each index and reported with paths such as $.items[0]. You can also enable Ignore array order to compare arrays as unordered collections, which is useful when the position of items does not matter.

Added means a path exists in Document B but not in Document A. Removed means a path exists in Document A but not in Document B. Changed means the path exists in both documents but the value or type differs between them.

Yes, type comparison is enabled by default. A string such as "1" and a number such as 1 are reported as changed when Compare value types is enabled. Disable this option when you only care about value differences and not type changes.

Yes. Enable Ignore array order when the arrays represent unordered collections and position is not meaningful. The comparison matches array items as a set, including nested objects, rather than comparing strictly by index.

Yes. Use the scope selector to show all rows, added only, removed only, or changed only. You can also type in the search field to filter paths, values, and change kinds in real time without rerunning the comparison.

No. Both inputs remain as you entered them. Swap A/B changes the comparison direction without rewriting the content. Clear removes both inputs from the workspace but does not affect any external files.

Yes. After both documents parse successfully, Copy report places the plain-text diff report on the clipboard and Download report saves it as json-diff-report.txt locally. Export is disabled until both inputs are valid JSON.

Yes. Both documents are parsed and compared using browser-native JSON.parse and JavaScript object traversal. The tool makes no network calls, does not upload either document, and does not persist inputs in localStorage.

JSON Validator checks whether a single JSON document is syntactically valid and reports the first parse error. JSON Diff requires two valid documents and produces a structural comparison showing exactly which paths and values changed between them.

Use Diff when you want to see exactly what changed between two versions — ideal for reviewing API responses or config edits. Use Compare when you just need to confirm whether two documents are semantically equal.

What is JSON Diff?

JSON Diff is a browser-based tool that compares two JSON documents structurally and reports every path that was added, removed, or changed. Unlike a text-line diff, which compares raw characters, a JSON Diff engine parses both documents into objects and traverses every key and array index, so a simple value change on a deeply nested property is reported precisely rather than as a confusing block of replaced lines.

Path-aware comparison with JSONPath notation

Every change is reported with its full JSONPath. A changed nested property appears as $.settings.theme, a changed array element as $.items[2].price, and a new top-level key as $.owner. This notation makes it immediately clear where in the document structure the change occurred, without requiring you to read both documents side by side.

Three change kinds: added, removed, changed

Added means a path exists in Document B but not in Document A. Removed means it exists in Document A but not in Document B. Changed means both documents have the path but the values differ. This classification is consistent for every depth level — a newly added nested object counts as one added path at the object level, with its children reported as added paths in turn.

Optional type-sensitive comparison

JSON uses distinct types: the string "1" and the number 1 are different values. With Compare value types enabled (default), these are reported as changed. Disable the option when you only care about value equality across types and want to ignore string-versus-number differences.

Optional array-order ignoring

JSON arrays are ordered by definition. When comparing two arrays that represent the same set of items in different orders, enable Ignore array order. The comparison then matches each item in Document A against any unmatched item in Document B using deep equality, so reordered elements are not reported as removed and added pairs.

Scope filter and search

After running the comparison, filter the report to show only added, only removed, or only changed rows. Type in the search field to narrow by path name, value content, or change kind — the report updates instantly without a second parse. This is useful when comparing large API responses where only a few specific paths matter.

Swap, clear, and local file input

Swap A/B reverses the comparison direction without changing either document — useful when you want to verify symmetric results or check what was added from the other side. Both Document A and Document B support local JSON file input via FileReader, so you can compare two files without uploading them. Clear resets the workspace entirely.

Export

Copy report places the full diff report as plain text on the clipboard. Download report saves it as json-diff-report.txt. Export actions are disabled until both inputs parse successfully, preventing accidental export of partial results.

Privacy

All parsing and comparison runs in your browser using JSON.parse and JavaScript object traversal. Neither document is uploaded to a server, no API call is made, and nothing is written to localStorage.

Common use cases

  • Comparing two API responses after a code change or deployment
  • Reviewing JSON configuration changes between environments
  • Finding added or removed fields in webhook payloads
  • Checking nested arrays and objects in updated test fixtures
  • Filtering a large diff to show only changed paths
  • Exporting a plain-text change report for a ticket or code review

Why use ToolsSonic's JSON Diff?

ToolsSonic's JSON Diff beats jsondiff.com, jsoncompare.com, and codebeautify.org/json-diff on every important feature.

True structural diff, not text diff — The engine parses both documents and traverses paths recursively. Text-line diffs at competitors fail on refornatted JSON, indent changes, and key reordering.

Full JSONPath on every row — Every change shows a complete JSONPath such as $.users[0].address.city. Most competitors show only the top-level key or a truncated path.

Four-column report with value previews — Each row shows the change kind, the full path, the Document A value, and the Document B value side by side. You can read the diff without switching tabs or scrolling.

Ignore array order — Correctly handles unordered collections without marking every reordered item as removed and re-added. Most free tools compare arrays strictly by index.

Scope + search filter — Filter to added-only, removed-only, or changed-only, then search paths and values. No competitor combines both filters on a single diff report.

Export gate — Report export is disabled until both documents are valid. You can never accidentally download a partial or broken diff.

Complete privacy — No uploads, no server calls, no localStorage writes.

100% private — runs in your browser Instant — no server round-trip Free forever — no account needed