{ }JSONKit.tools

JSON Diff — Compare Two JSON Files

Compare two JSON documents by structure, not by text: reordering keys or reformatting produces no diff. Read it side by side, as a folding tree, or as a flat list of paths.

Left

Right

Diff

–

About this tool

A line-based diff is the wrong tool for JSON. Reformat a file or reorder its keys and every line turns red, even though the data never moved. This page parses both documents and compares them by path, so the only differences reported are real ones: a value that changed, a key that appeared, a key that went away. Array elements are matched by content rather than index, which is why deleting one item from a long list shows up as a single removal instead of a cascade.

How to use it

  1. 1Paste the two documents into the left and right panels.
  2. 2Read the result in whichever view fits — Split, Tree or List.
  3. 3Turn on Changes only to fold away everything that stayed the same, then Copy the summary.

Frequently asked questions

›Why does reordering keys show no difference?

Because this compares structure, not text. JSON objects are unordered by definition, so {"a":1,"b":2} and {"b":2,"a":1} hold the same data and are reported as identical. A line-based diff tool would paint both files red.

›How are arrays compared?

Elements are matched by content, not position, so removing one item from a long list is reported as one removal rather than "everything after it changed". When a removal and an insertion line up, they are shown as one changed element.

›Which view should I use?

Split for the familiar side-by-side read, Tree when the document is deep and you want untouched branches folded away, List when you need to paste "what changed" into a ticket. All three are the same comparison, rendered differently.

›What does Changes only do?

In Split it collapses long runs of untouched lines into a marker, the way a code review does. In Tree it hides branches with nothing in them. The List view is only changes to begin with.

›Can I compare two YAML or XML files?

Convert them to JSON first — the YAML to JSON and XML to JSON pages do that in one paste — then compare the results here. The comparison itself is format-agnostic.

›Is anything uploaded?

No. Both documents are parsed and compared in your browser, which is what makes it safe to diff a production config against a staging one.