JSON format

There are just a few rules that you need to remember:

Else we come up with some error,

  • Objects are encapsulated within opening and closing brackets { }
  • An empty object can be represented by { }
  • Arrays are encapsulated within opening and closing square brackets [ ]
  • An empty array can be represented by [ ]
  • A member is represented by a key-value pair
  • The key of a member should be contained in double quotes. (JavaScript does not require this. JavaScript and some parsers will tolerate single-quotes)
  • Each member should have a unique key within an object structure
  • The value of a member must be contained in double quotes if it’s a string (JavaScript and some parsers will tolerates single-quotes)
  • Boolean values are represented using the true or false literals in lower case
  • Number values are represented using double-precision floating-point format. Scientific notation is supported
  • Numbers should not have leading zeroes
  • “Offensive”” characters in a string need to be escaped using the backslash character
  • Null values are represented by the null literal in lower case
  • Other object types, such as dates, are not properly supported and should be converted to strings. It becomes the responsability of the parser/client to manage this.
  • Each member of an object or each array value must be followed by a comma if it’s not the last one
  • The common extension for json files is ‘.json’
  • The mime type for json files is ‘application/json’



JSON (JavaScript Object Notation) is a lightweight data-interchange format.

-> JSON is text-based open standard designed for human-readable data interchange.

->A Web data publishing format that is designed to be both easily human — and machine — readable.

->Simple format for data exchange over the internet (used as an alternative to XML)

->The JSON is used for data interchange between programs, an area in which the ubiquitous XML is not too well-suited.

->it’s largely adopted and supported by the most part of programming languages.

->it’s a language-independent format..

->can be compressed in one line to reduce stream size.

->can represent the most part of standard objects.

->seamlessly integrates with JavaScript which makes JSON the standard for streaming data over AJAX calls.