JSON Diff: Compare JSON Objects

Paste two JSON documents to see exactly what changed. Every difference is listed by path, like $.users[2].email, and formatting or key order never cause false alarms.

Runs in your browserNo sign-upNothing uploaded

Key order is always ignored.

How to use the JSON Diff

  1. Paste the original JSON on the left and the modified JSON on the right, or open two files.
  2. Syntax errors are shown under each box with the line and column, so you can fix them quickly.
  3. Read the Changed paths table: each row shows whether a value was added, removed or changed, with old and new values.
  4. Tick Ignore array order when lists are sets, for example tags or permissions.
  5. Scroll to the side-by-side view to see the changes in context, or copy the change list as JSON.

Why a structural JSON diff beats a text diff

A plain text diff compares characters and lines, so two JSON files that hold the same data can look completely different if one is minified, indented differently or has keys in another order. This tool parses both documents first and compares the data: objects are compared key by key regardless of order, and numbers, strings, booleans and null are compared by value. Only real changes are reported.

How changes are reported

Each difference gets a JSONPath-style location, such as $.owner.email or $.items[3].price, and one of three types:

  • added: the key or array element exists only in the modified JSON.
  • removed: it exists only in the original JSON.
  • changed: it exists in both but the value differs, including type changes such as a string becoming a number.

Arrays are aligned with a longest-common-subsequence algorithm, so inserting one element at the start of a list is reported as a single addition instead of marking every following element as changed.

Ignoring array order

Many APIs return lists whose order carries no meaning, such as roles, tags or IDs. With Ignore array order on, arrays are compared as collections: an element only counts as added or removed if it has no equal counterpart on the other side. The side-by-side view then sorts array elements so equal lists line up.

Typical uses

Compare API responses between staging and production, check what a migration changed in a config file, review differences between two package.json or tsconfig files, and debug snapshot tests.

Frequently asked questions

Does key order matter when comparing JSON?
No. JSON objects are unordered, so {"a":1,"b":2} and {"b":2,"a":1} are reported as equal. Array order does matter by default because arrays are ordered, but you can turn that off with Ignore array order.
Is my JSON uploaded to a server?
No. Both documents are parsed and compared in your browser. Nothing is sent over the network, which makes the tool safe for API responses containing tokens or customer data.
What do paths like $.users[2].email mean?
$ is the root of the document, .users is a key, and [2] is the third element of an array (indexes start at 0). Keys with spaces or special characters are written in brackets, like $["first name"].
Is 1 equal to 1.0?
Yes. Both parse to the same number, so they are not reported as a difference. A number and a string, such as 1 and "1", are different and are reported as changed.
Can I compare JSON with comments or trailing commas?
Standard JSON does not allow them, so such input is flagged with the exact line and column. Remove the comments or commas, or clean the document in the JSON Formatter first.

Related tools