JSON vs XML


JSON Introduction

The below following points defines the JSON.

  • Douglas Crockford originally specified the JSON format in the early 2000s. He and Chip Morningstar sent the first JSON message in April 2001.
  • JSON stands for JavaScript Object Notation is a standard text-based format for representing structured data based on JavaScript object syntax .
  • JSON is the leading data interchange format for web applications.
  • JSON filenames use the extension .json

JSON is based on two types of structures:

  • A group of name/value combinations. This is implemented as an object, record, struct, dictionary, hash table, keyed list, or associative array in a variety of languages.
  • An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.

These are universal data structures. They are essentially supported by all contemporary or modern programming languages. It makes sense for a data format to be built on these structures and to be convertible with computer languages.

Read More.....

XML Introduction

XML stands for extensible Markup Language similar to HTML, where HTML stands for Hypertext Markup language. HTML is used for creating websites, whereas XML can be used for any kind of structured data. The whole structure of XML and XML-based languages is built on tags. So XML is used to store and transport data.

The tags are work in XML similar to HTML. The start tags start with the < > and end with the </ >. The start and end tag text must match.

Example

<website>
<title>Learning XML</title>
<url>https:tutorialstrend.com</url>
<year>2023</year>
</website>

JSON Popularity Graph

From desktop to web and mobile, nearly all computer applications that we use today rely on one of two principal message standards: JSON and XML. Today, JSON is the most widely-used format, but it only overtook XML within the last five years. The history and evolutionary path of the web has played a significant role in the popularization of JSON. According to Stack Overflow, more questions are now asked about JSON than about other data interchange formats.

According to Google Trends,

Json XML Popularity

Difference Between the JSON & XML

SNo.  JSON    XML 
1 JSON stands for javascript object notation. XML stands for an extensible markup language.
2 The extension of json file is .json. The extension of xml file is .xml.
Less code is created than XML More code require than JSON
4 The data types supported by JSON are strings, numbers, Booleans, null, array. XML data is in a string format.
5 JSON has no tags. XML data is represented in tags with start tag and end tag.
6 JSON can use arrays to represent the data. XML does not contain the concept of arrays.
7 It is less secure than XML. It is more secure than JSON.
8 JSON is data-oriented. XML is document-oriented.
9 The internet media type is application/json. The internet media type is application/xml or text/xml.
10 It is a language-independent data-interchange format. It is an independent data format.

Prev Next