JSON vs XML

JSON vs XML

You exchange information daily with people via social media using text, photos, videos. Text, photos, and videos are data formats using which you convey thoughts.

A well-designed data format makes the information easiest to understand.

The same principle applies when two systems connect and share data using APIs. One system has to format the data in a way that other system can understand. The most common formats used in API world are JSON and XML.

JSON (JavaScript Object Notification)

JSON is the most popular data format when data is exchanged using APIs. Below are features that make JSON favorite among developers.

  • JSON is self-explanatory and easy to understand
  • JSON is lightweight
  • JSON is language independent

JSON Syntax Rules:

  • JSON data is in key/value pairs
  • JSON data is separated by commas
  • Curly braces hold JSON objects
  • Square brackets hold JSON arrays
JSON Syntax


XML (eXtensible Markup Language)

XML has been around since 1996. With age, it has become more mature and powerful data format. Like JSON, XML also uses syntax to structure the data.

XML Syntax Rules:

XML Syntax


  • XML starts with root node, called a parent node
  • Inside parent node, there are child nodes



Similarities between JSON and XML

  • Both JSON and XML are "self-describing" (human-readable)
  • Both JSON and XML are hierarchical (values within values)

Dissimilarities between JSON and XML

No alt text provided for this image

Thanks for reading

要查看或添加评论,请登录

Parag Paratkar的更多文章

  • PSD2 & Open Banking

    PSD2 & Open Banking

    In recent times, PSD2/Open Banking has become a buzzword in Fintech world. It is indeed a revolutionary concept which…

    2 条评论
  • A Guide To Product Metrics and KPIs

    A Guide To Product Metrics and KPIs

    Management thinker Peter Drucker is often quoted as saying that “you can’t manage what you can’t measure.” Whether…

    1 条评论
  • How to Read API Documentation: A Step-By-Step Guide

    How to Read API Documentation: A Step-By-Step Guide

    Are you feeling overwhelmed by the complex API documentation? After going through more than 30 API documentations, I am…

  • What It Takes to be a Technical Product Manager

    What It Takes to be a Technical Product Manager

    What is Technical Product Manager? Every great team needs a tech person. A technical product manager (TPM) is a product…

    2 条评论
  • HTTP != REST

    HTTP != REST

    Very often, you read HTTP and REST together. Many think that HTTP and REST go hand-in-hand.

  • Don't know what REST API is !! #techfornontech

    Don't know what REST API is !! #techfornontech

    #lesson2 What is REST API or RESTful API? When we converse in English language, we follow a set of grammar rules…

  • API Introduction #techfornontech

    API Introduction #techfornontech

    #lesson1 Technology has become an integral part of every business. Whether you like it or not, you need to understand…

社区洞察

其他会员也浏览了