JSON Diff

Your input is processed only in this browser. See the privacy policy.

How to use it

  1. Paste valid JSON on the left and right, or drop a local file into each labeled box.
  2. Open comparison options to ignore volatile paths or match object arrays using a key such as id.
  3. Read the formatted line diff, explore JSON paths in the tree, or export the change list as CSV.

Examples

Ignore timestamps, keep price changes

With $.meta.updatedAt ignored, a price change is still reported. For the documents below the summary is added 0, removed 0, changed 1.

Input
{"price":10,"meta":{"updatedAt":"old"}} → {"price":12,"meta":{"updatedAt":"new"}}
Result
$.price: 10 → 12

Array matching without reorder noise

Compare [{"id":1},{"id":2}] with [{"id":2},{"id":1}]. Index mode reports two changed IDs; key mode using id reports no differences. The exact JSON Patch still reproduces the right-hand order.

Details

This tool compares JSON structure rather than lines of raw text. Whitespace outside strings does not count as a change. By default, object member order is ignored, arrays are compared by index, and equivalent number spellings such as 1, 1.0 and 1e0 compare equally. Disable numeric equivalence to inspect number spelling.

Ignore rules match a small, explicit path language. A matched node and its descendants disappear from the comparison, but remain in copied JSON and in the exact patch. Key matching applies to every compared array, requires unique string or numeric identifiers, and does not guess a fallback for missing IDs.

JSON Patch uses RFC 6902 add, remove and replace operations and RFC 6901 pointer escaping. Operations apply from left to right; array removals run from the highest index downward. This export always includes original differences even when the comparison hides them. It preserves JSON values and array order, not whitespace or object member order.

Frequently asked questions

When should I use line diff or tree diff?

Use line diff for surrounding document context and tree diff for nested structure and exact JSON paths. Both follow the object-key sorting option.

Why can the patch contain changes when the summary says zero?

Comparison options can hide differences. The patch deliberately uses both originals so applying it produces the right-hand document, including ignored paths and reordered arrays.

Can I use a full JSONPath expression?

No. Use $, simple .member names, numeric [0] indices and array [*] wildcards, one path per line.

What happens when array IDs are missing or duplicated?

Key mode reports an error at the array or item. Choose a unique string or number key, or switch to index mode.

Are my files uploaded or remembered?

No. File reading and comparison happen locally in browser memory.