The Verbosity of XML
It is an undeniable fact, even the proponents of XML would agree that it is redundant to write. In case you are coding from scratch, you will have to focus on starting and closing tags keenly. Many XML programmers would argue that editor is always there to help out in such situations. But still, you will have to revisit again and again every single line of code to cross-check whether you have added the tags or not. Because if your code misses a single tag, it would become a bug and finding out such minor error is the most laborious task.
Whereas JSON is less verbose, and amazingly, it is lightweight, which makes it easy to transmit the data from the web application to the server and vice versa.
Lack of Semantics in XML
XML lacks in semantics, the syntax of this format is meaningless and is not able to even correlate with the data or content, the abstract data model of this format uplifts itself from the data and configure the content by its own element attributes. XML on its own define the meaning of data in the elements, which makes it not a readable format for human beings. It is basically Meta-language and free from semantic. On the other hand, JSON is based on semantics, which makes it easy for the human to interpret the data and for the machines to parse the information.
In the last analysis, developers prefer JSON over XML. Because of the reasons mentioned above. And for that reason, the former has gained strong footprints over the web. And most of the people are switching their sites from XML to JSON. It is recommended by tech experts to use JSON because it will enhance the user-interaction with your web application. And you will be able to deliver a user-friendly experience to your users.