This article explains the main differences between these two data formats and when to use JSON vs XML. In short: use JSON over XML when possible.
Json Editor OnlineCompare Indepth
JSON compare: how to compare two JSON files?
To compare JSON data in a meaningful way, you should compare the data contents, not the plain text contents. There is a handy tool for that. Read on to learn more.