JSON Diff

Compare two JSON documents and see added, removed and changed values by path, with a JSON Patch download. Free, runs in your browser.

Original
Changed

About JSON Diff

JSON Diff compares two JSON documents and lists every difference by path: what was added, removed or changed. Download the changes as a JSON Patch.

Compares values, not text

Key order, spacing and 1 versus 1.0 never count as changes, so you see only real differences.

Ignore array order

Turn it on when lists like tags can be in any order.

Clear paths

/o/new means the key new inside o; /tags/0 is the first item of tags.

Good for

Checking an API response before and after a change, comparing config files and writing test assertions.

Private

Everything runs in your browser. Nothing you paste is uploaded.

What is JSON Patch?

JSON Patch (RFC 6902) is a standard list of operations such as add, remove and replace, each with a path. Applying it to the first document produces the second.

How to use JSON Diff

  1. Paste the original JSON into the first box and the changed JSON into the second.
  2. Choose Arrays: compare by position or Arrays: ignore order.
  3. Press Compare.
  4. Review the differences, or copy them or download the JSON Patch.

Related guide: How to Format and Validate JSON (With Common Errors Explained)

Help & FAQ

What does JSON Diff do?

It compares two JSON documents and lists added, removed and changed values by path.

What is the difference between the two array modes?

By position compares item 0 with item 0 and so on. Ignore order treats arrays as sets, so the same items in another order are equal.

Is 1 different from 1.0?

No. They are the same JSON number, so the tool does not report a change. In the test n changed from 1 to 1.0 with no difference shown.

Does key order matter?

No. The comparison is by key, so reordering keys is not a difference.

What do the paths mean?

They use JSON Pointer style: /o/new is the key new inside o, and /tags/0 is the first item of tags.

What is the JSON Patch download?

It is a list of operations in the RFC 6902 format that, applied to the original, produces the changed document.

What happens with invalid JSON?

It shows Invalid original JSON or Invalid changed JSON with the parser message and does not compare.

Can we swap the two sides?

Yes. The Swap button exchanges the original and changed boxes so added and removed switch places.

Is there an example?

Yes. Press Load example to fill both boxes with sample documents.

Will it compare very big files?

It works in your browser, so the limit is your computer's memory. Very large files may be slow.

Does it compare text line by line?

No. It compares JSON values. For plain text files use the Text Compare tool.

Is our JSON uploaded?

No. The comparison runs in your browser.

More in Developer Tools

See all 39 in Developer Tools