How to use it
- Paste the original JSON on the left and the changed JSON on the right, or try the example.
- Choose how arrays are compared: by position, or matching items so that an inserted item is reported once.
- Read the differences as a list or side by side. Each one has a path from the root ($).
- Copy the report to paste it into a ticket or code review.
How it works
Both documents are parsed and compared as data, not as text. Objects are compared key by key, so the order of keys and the whitespace or indentation do not matter. Numbers are compared by value, so 1 and 1.0 are equal.
Each difference has a path written like a JSONPath expression: $ is the root, .name is a property, [2] is an array index, and keys that are not simple names are quoted, as in $["first-name"]. Four kinds of difference are reported: added (only on the right), removed (only on the left), changed (same type, different value) and type changed (for example the number 44.9 became the string "44.90", or a value became null). When a whole object or array is added or removed, it is reported once at its own path rather than once per field.
Arrays are compared by position by default: item 0 with item 0, item 1 with item 1. If an item is inserted at the start, every later item then looks changed. “Match moved items” first aligns the two arrays using a longest common subsequence of equal items, so an insertion or deletion is reported only once and the remaining items are paired up. Added items use their index on the right, removed items their index on the left. Matching is skipped for very large arrays (over about 2 million item pairs), which are then compared by position.
Key paths in the list are sorted alphabetically within each object. Up to 2,000 differences are displayed; the copied report always contains all of them.
Examples
Checking an API change
Compare yesterday's and today's response for the same order. The diff shows $.status changed from "pending" to "shipped", $.total changed type from number to string, $.coupon removed and $.customer.phone added.
Configuration drift
Paste the JSON config from staging and from production. Because key order is ignored, only real differences such as $.cache.ttl 300 → 60 appear, even if the files were saved by different tools.
Lists with an inserted item
A product list gained a new first item. By position, every product appears changed; with “Match moved items”, the result is a single “Added $[0]”.
Frequently asked questions
How is this different from a text diff?
A text diff compares lines, so reordering keys or reformatting shows up as changes. This tool compares the parsed data, so only differences in values, types and structure are reported.
Why does an array show many changes after one insertion?
In “By position” mode, items are compared at the same index, and an insertion shifts every later item. Switch to “Match moved items” to align equal items first.
Are "1" and 1 treated as equal?
No. One is a string and the other a number, so the difference is reported as a type change. Values with the same type are compared exactly.
Can I compare very large files?
Files of a few megabytes work, but everything is processed in your browser's memory, so very large documents may be slow on phones.
Privacy
Both documents are parsed and compared only in your browser. Nothing is uploaded, stored or included in analytics.