JSON Diff & Compare Tool
Compare two JSON documents by data, with JSON Patch output. Runs in your browser.
About this json diff & compare tool
This JSON diff compares two JSON documents by their data, not their text. Paste the original and the changed version and you get a side-by-side view, a unified diff, a list of every changed path, and an RFC 6902 JSON Patch that turns one into the other.
Key order is ignored by default, because JSON objects are unordered. You can also ignore array order, ignore letter case in strings, and leave out keys such as updatedAt or etag that change on every request.
Both documents stay in your browser. That matters when you are comparing production API responses full of customer data.
Features
Four views of the same diff
Side by side with changed words highlighted inside each line, a unified diff you can save as a .diff file, a change list of paths like $.items[0].qty with old and new values, and a JSON Patch.
Ignore what does not matter
Key order is off by default. Tick Ignore array order to treat lists as sets, Ignore case for strings, and type key names to skip, separated by commas. The options apply at every depth.
Smart array matching
Array items with an id, _id, uuid, key, slug, sku, name or code field are matched by that field, so inserting one item at the top shows as one addition instead of every row changing. Reordered items show as moves.
RFC 6902 JSON Patch
The patch view lists add, remove, replace and move operations with JSON Pointer paths (RFC 6901). Copy it into a PATCH request or a test fixture.
Errors on either side
If one side is not valid JSON, the line, column and reason appear under it, using the same strict parser as the JSON formatter. Pretty-print tidies either side with one click.
How to use the json diff & compare tool
- 1Paste the original JSON on the left and the changed JSON on the right.
- 2Choose what to ignore: key order, array order, letter case or named keys.
- 3Read the side-by-side, unified or change list view, or copy the JSON Patch.
When to use it
Checking what an API change broke
Save yesterday's response and today's, paste both, and look at the change list. A renamed field shows as one removal and one addition next to each other.
Reviewing config drift
Compare the staging and production versions of a settings file. Ignore keys like lastDeployed so only real setting changes show.
Writing a PATCH request
Edit a copy of the resource, diff it against the original, and copy the JSON Patch body instead of writing operations by hand.
Debugging a snapshot test
When a test prints two large objects, paste them here instead of scrolling a terminal. Payloads that came in as a JWT can be decoded first with the JWT Decoder.
How do I compare two JSON files?
Paste the older version on the left and the newer on the right, or open each file with its own Open file button. The result appears below as soon as both sides parse. Use Swap sides if you put them in the wrong order, since additions and removals flip.
A plain text diff treats JSON as lines, so reformatting or moving one key around makes the whole file look different. This tool parses both sides first, normalizes them with your options, and compares values. Formatting never shows up as a change.
Does key order matter in JSON?
Not for the data. RFC 8259, the JSON standard, defines an object as an unordered collection of name and value pairs, so {"a":1,"b":2} and {"b":2,"a":1} mean the same thing. The structural diff and the change list never report key order.
Array order is different. [1,2,3] and [3,2,1] are different arrays, and most APIs care about order. When you know a list is really a set, such as tags or permissions, tick Ignore array order and the items are sorted before comparing.
What is JSON Patch?
JSON Patch, defined in RFC 6902, is a list of operations that change one JSON document into another. Each operation has an op (add, remove, replace, move, copy or test) and a path written as a JSON Pointer like /items/0/qty. Servers that accept the application/json-patch+json content type apply the list in order.
The patch here is built from the normalized documents, so if you ignore keys or array order the patch skips those differences too. Turn the ignore options off if you need a patch that reproduces the right side exactly.
Why use Mavros
| Mavros | Typical upload sites | |
|---|---|---|
| Compares | Parsed values, with key order ignored | Lines of text |
| Ignore options | Array order, case and named keys | Usually whitespace only |
| Array matching | Matches items by id-like fields, shows moves | Position only |
| Output | Side by side, unified, path list, JSON Patch | One colored view |
| Where your data goes | Stays in your browser | Often uploaded or saved to a share link |
Tips
- Very long numbers such as 64-bit IDs lose precision in JavaScript. If two IDs differ only in the last digits, check them in the JSON Formatter & Validator, which keeps every digit.
- Hide unchanged lines keeps three lines of context around each change. Turn it off to see the full documents.
- The change list copies as plain text with + for added, - for removed and ~ for changed, which reads well in a ticket.
- Need a diff of non-JSON text? Use the text diff tool for prose and code.
Questions
How do I compare two JSON objects online?
Paste one into each box. The differences appear below in a side-by-side view, and the change list names every path that was added, removed, changed or moved. Nothing is uploaded.
Does this JSON diff ignore key order?
Yes, by default. JSON objects are unordered under RFC 8259, so key order is never a difference in the change list. The side-by-side view also sorts keys unless you untick Ignore key order.
Can I ignore the order of items in an array?
Yes. Tick Ignore array order and every array is sorted by its contents before comparing, at every depth. Use it for lists that act like sets, such as tags or roles.
How do I ignore fields like timestamps?
Type their names in Ignore these keys, separated by commas, for example updatedAt, etag. Those keys are removed everywhere in both documents before the comparison.
What is the difference between the unified and side-by-side views?
Side by side puts the two versions in columns with changed words highlighted. Unified shows one column with - for removed lines and + for added lines, the format git and code review tools use.
What is a JSON Patch used for?
It is a standard (RFC 6902) way to send only the changes to a server in an HTTP PATCH request. It is also handy as a compact record of what changed between two versions.
Why does a moved array item show as a move?
When items have an id-like field, they are matched by it. If the same item sits at a new index, that is reported as a move rather than a deletion plus an insertion.
Is my JSON sent anywhere?
No. Both documents are parsed and compared in your browser tab. The address bar stores only your view and ignore options, never the JSON.