Xponent logo Xponent
Specialists In Large XML Documents Privacy Policy  Contact

Xponent's Mostly XML Blog


JSON vs XML

There has been a substantial debate in recent years on choosing between JSON and XML as a data format. There are many proponents and arguments on both sides. All the discussions I have read simply list advantages and disadvantages, but fail to put them in the context of specific use cases. Without such context, the relative merits are meaningless. One advantage commonly sited for JSON is that it is "lightweight" and, indeed, it is. But so what? There are projects where that is not a criterion at all.

To me, the bottom line is simple: use the best tool for the job. In some cases JSON works best and XML in others. There are extreme use cases which make the choice easy. For example, suppose the job is choosing a storage format for a complex technical training manual with images, say for repairing a jet engine, for publication on a web site in many languages. XML is clearly a better choice than JSON because it has better support for mixed content and supports virtually every character encoding. If the job is to send numerical data over the wire as quickly as possible, JSON Would be a better choice than XML because it requires fewer bytes.

Most tasks are somewhere between these two extremes and require careful evaluation based on all the specifications of the project. Discussions which state or imply that JSON is universally superior to XML, or vice versa, are naive at best. JSON and XML each have their place and neither is going to disappear. In fact, I see the use of both JSON and XML growing, but the growth will be in domains where they represent the best fit.

Submitted by Bill Conniff, Founder of Xponent, on June 3, 2011




Copyright Ⓒ 2008-2023. Xponent LLC. All rights reserved.