Introduction of JSON

In this blog, I’m explaining the concept of JSON. The JSON is the Java Script Object Notation that is used storing and exchanging the data.


What is JSON?

JSON is the JavaScript Object Notation. It is used for data store and interchange. It is very lightweight that is text based open standard human readable data exchange. It is basically used for the data exchanging.

It is driven by the JavaScript scripting language. JSON is the language for the data formatting. The JSON used many server side languages like ASP, PHP, Perl, Python, Ruby, JSP, etc.

JSON is alternatively as XML. It is easier to use from XML.

The JSON Example for three student record:

{“students”: [{“name”:”Ajay Mishra”, “age”:20, “address”:”Allahabad","phone":"555 1234568"},{“name”:”Satish Kumar”, “age”:21, “address”:”Allahabad","phone":"555 1234569"},{“name”:”Ajay Mishra”, “age”:22, “address”:”Allahabad","phone":"555 1234560"}]}

This define in the XML:




<name>Ajay Mishra</name>



<phone>555 1234568</phone>



<name>Satish Kumar</name>



<phone>555 1234569</phone>



<name>Manoj Kumar</name>



<phone>555 1234560</phone>



JSON uses JavaScript syntax, but the JSON format is text only, just like XML. Text can be read and used as a data format by any programming language.


Similarity in JSON and XML

There are following similarity in the JSON and the XML:

·         JSON and XML both support the plain text.

·         Both contain self-describing text data.

·         Both serve as a serialization format for objects.

·         JSON and XML both can be fetched with an HttpRequest.


Difference between JSON and XML

There are following key feature that different from the XML and JSON:

·         JSON does not support end tag.

·         JSON is easier than XML to read and write.

·         JSON is shorter in comparison of XML.

·         JSON can use the arrays and XML use the parent tags.


Why use JSON?

We should use the JSON for many reasons and purposes:

·         JSON provide the clean data that give the object oriented programming.

·         JSON provide the efficiency for the code. If you use the Ajax to show dynamic data then it is easier with the JSON.

·         JSON provide the scalability if your server side outputting the standard data format then it is easier to change and expand your application.


In this blog, I’m explaining what is JSON and why use it and also how different with the XML.

I hope this blog is helpful for you. Thanks!

Leave Comment