Diff & Merge

JSON Diff

Compare two JSON documents by structure: every added, removed and changed value with its path, exact numbers and a JSON Patch.

Original

11 lines · LF

Changed

12 lines · LF

Paste JSON on both sides to compare.

About this tool

Paste or drop two JSON documents and get every difference in the data, each with its path: values that changed, keys and items that were added or removed, and values whose type changed, such as a number that became a string. Formatting, whitespace and, unless you ask, key order don’t count.

Numbers are compared exactly as written, so values too large for JavaScript, like database IDs, aren’t rounded into looking equal. Choose how arrays are compared: in order, finding inserted and removed items; item by item; matched by an identifying field such as “id”, which also shows items that moved; or as sets where order doesn’t matter.

Download a report of every change, and, when arrays are compared in order, a JSON Patch (RFC 6902) that turns the first document into the second. Comments and trailing commas can be allowed for config files.

Why compare JSON by structure instead of as text?

Two documents can mean exactly the same thing yet differ in indentation, key order or how numbers are written. Comparing the data shows only real changes, each with the path to where it is.

What happens with duplicate keys?

JSON allows the same key twice in an object, but most programs keep only the last value. The comparison does the same and tells you when it happened.

esc
  • Opens in its own window, like any app
  • Works without an internet connection
  • Starts instantly from your home screen or dock

Look for the install icon at the right end of your browser’s address bar, or open the browser menu and choose Install Interformat.