Free Online JSON Diff, Compare Two Documents By Structure
Compare two JSON documents in your browser and get a list of what actually changed, by path. Because the comparison walks both trees rather than the text, reordered keys and different indenting are not reported as differences. Values whose type changed are listed separately, since that is the change that breaks code quietly.
Enjoying WizTools123? Help keep our server infrastructure 100% free and open for everyone.
How to Use JSON Diff and Compare
Step by step, start to finish.
Paste it or drop a file. The sample pair is already loaded, with a few differences of each kind to look at.
Two boxes rather than two files, because comparing two API responses usually means two things on the clipboard.
Leave it on position for a list where order matters, such as steps. Switch it off for a set of tags or ids, where order means nothing.
The readable list is for a person. The JSON Patch output is for applying the change somewhere else.
Key Features
What this tool does, and what it does not do.
Both trees are walked, so key order and formatting never appear as differences.
A number becoming text is called out on its own, because it is the change that quietly breaks code.
Ignore position for the arrays that are really bags of tags or ids.
Exclude timestamps and request ids so a live comparison reports only real changes.
An RFC 6902 patch of add, remove and replace operations, ready to apply elsewhere.
Both documents are parsed in this tab, so production responses stay put.
About JSON Diff and Compare
Comparing two JSON documents with a text diff is one of those habits that feels productive and wastes an afternoon. The tool is right there, it runs instantly, and it reports fifty differences in two files that are identical apart from the order their keys happen to be written in. JSON objects have no defined order, so a server is free to emit the same data in a different sequence on every call, and a line based diff treats that exactly like a real change.
Walking the parsed trees instead gives a short answer: these keys were added, these were removed, these values changed, and here is the path to each. The report is about the data, which is what you were asking about. It is also stable: run it twice on the same pair and you get the same list, however differently the two files are indented.
The one thing worth separating out is a change of type. When a field that held the number 1007 starts holding the string "1007", nothing looks broken. The document is valid, the value reads the same to a human, and most schema checks let it through. The code comparing it to a number stops working and the bug surfaces somewhere else entirely, which is why those changes get their own list rather than being mixed in with ordinary edits.
What can I adjust?
- Ignore the order of items in arrays, for arrays that are really sets of tags or ids rather than sequences.
- Treat tiny number differences as equal, so floating point rounding noise is not reported as a change.
- List type changes separately, the switch behind the separate list described above.
- Ignore these paths, such as a timestamp or a request id, which differ on every call to a live API.
What does the report look like?
Choose a readable list, a JSON summary, or a JSON Patch following RFC 6902, and tick Include what stayed the same when you want the unchanged paths listed as well. Counters above the report show how many paths were added, removed, changed and changed type. The patch is deliberately literal, a plain series of add, remove and replace operations, so it is easy to read through and check before you apply it to anything.
If one of the documents will not parse, the JSON Validator points at the exact line and column of the fault, so you can fix it and compare again.
Frequently Asked Questions
Common questions about this tool.
More JSON Tools
Other tools from the same hub, free and in your browser.
Feedback
No feedback on this tool yet. Yours would be the first.