JSON Diff

Runs in browser JSON & Data

Compare two JSON payloads structurally rather than as text. Key order is ignored, and every difference is listed with its JSON path, old value and new value — ideal for comparing API responses between environments.

Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

What is JSON?

JSON (JavaScript Object Notation) is a text format for structured data built from objects, arrays, strings, numbers, booleans and null. It is defined by RFC 8259 and ECMA-404, is language-independent, and is the default format of web APIs because it is compact, human-readable and easy to parse.

Read the guide: What is JSON?

How to use JSON Diff

  1. Paste the original document on the left and the modified one on the right.
  2. Tick "Ignore array order" if array position does not matter for your data.
  3. Click Compare to see the summary, the difference table and the line view.
  4. Download the table when you need to attach the changes to a ticket.
By default a reordered array reports every shifted index as changed; with “Ignore array order” ticked, only the item that really changed is left.

“Ignore array order” offDefault

Items are compared by index: [0] with [0], [1] with [1]…

features rows in Differences:
3
Summary: Changed:
5
  • $.features[0] changed "cart" → "coupons"
  • $.features[1] changed "coupons" → "cart"
  • $.features[2] changed "wallet" → "gift-cards"

“Ignore array order” on

Items are matched by content, so the moved "cart" and "coupons" find their match and are not reported

features rows in Differences:
1
Summary: Changed:
3
  • $.features[2] changed "wallet" → "gift-cards"

The tool’s example (Load example): features is ["cart","coupons","wallet"] on the left and ["coupons","cart","gift-cards"] on the right. Its other differences are the same in both modes.

JSON Diff features

  • Semantic comparison — key order, whitespace and formatting are ignored
  • Every difference listed with JSON path, change type, old value and new value
  • Optional "ignore array order" mode for set-like arrays
  • Line-by-line diff view of both pretty-printed documents
  • Summary counters for added, removed and changed values
  • Exports the difference table as CSV

JSON Diff example

Compare two configuration versions

Input:

Left: {"version":"1.4.0","limits":{"rps":100}}
Right: {"limits":{"rps":150,"burst":200},"version":"1.5.0"}

Output:

$.version   changed   "1.4.0" → "1.5.0"
$.limits.rps   changed   100 → 150
$.limits.burst   added   → 200

Frequently asked questions about JSON Diff

What does "semantic" comparison mean?

The two documents are parsed and compared as data, not as text. Key order, whitespace and indentation never count as differences — only actual values do.

Can I ignore the order of array items?

Enable "Ignore array order". Items are then matched by content, so ["a","b"] and ["b","a"] are considered equal.

What do the change types mean?

Added: the key exists only on the right. Removed: only on the left. Changed: both exist but the value differs. Type changed: the value switched type, e.g. from a string to an object.

How are differences reported?

Every difference is listed with its JSON path plus the old and new value, and a line-by-line view of both pretty-printed documents highlights the changes visually.

Technical notes

Both inputs are parsed and walked in parallel. Objects are compared by key, arrays by index (or by canonical content when array order is ignored), and primitives by value. The line view pretty-prints both documents with sorted keys and runs a longest-common-subsequence diff, falling back to a coarse diff for extremely large inputs.

References