Introduction to JSON :

JSON is lightweight syntax to store and interchange text information that can be read by many programming languages. JSON is supported by many browsers.

JSON was developed by Douglas Crockford and presented to the Internet community in 2006. It was formally made part of the ECMAScript standard, on which JavaScript is based, as of the Fifth Edition finalized in April 2010.

  1. JSON Stands for : JavaScript Object Notation.
  2. JSON is used to store and and exchange text information.
  3. JSON is like XML
  4. JSON is faster than XML.
  5. JSON is easier to parse.

Sample JSON Representation :

{
"student": [
{ "firstName":"Pritesh" , "lastName":"Taral" }, 
{ "firstName":"Anna" , "lastName":"Patil" }, 
{ "firstName":"Peter" , "lastName":"Smith" }
]
}

In the above snippet , We have stored three student records.
Above Code is equivalent to following XML Structure -

<?xml version="1.0" encoding="UTF-8" ?>
<student>
    <firstName>Pritesh</firstName>
    <lastName>Taral</lastName>
</student>
<student>
    <firstName>Anna</firstName>
    <lastName>Patil</lastName>
</student>
<student>
    <firstName>Peter</firstName>
    <lastName>Smith</lastName>
</student>

In short -

  1. JSON is self descriptive.
  2. JSON is Lightweight
  3. JSON is easy to parse
  4. JSON is Language Independent.(Though it uses JavaScript)
  5. JSON is Easy to Understand.

Must Read Articles :

  1. Introducing JSON
  2. JSON described in RFC 4627
  3. JSON Wiki
  4. Jackson official website
  5. Gson official website
  6. JSON.simple official website
  7. Review of 5 Java JSON libraries
  8. Jackson vs Gson