What is JSON
- JSON is a lightweight text-based open standard designed for human-readable data interchange.
- JSON is easy for humans to read and write. It is easy for machines to parse and generate.
JSON VS XML
Source : http://www.json.org/xml.html
XML is simpler than SGML, but JSON is much simpler than XML. JSON has a much smaller grammar and maps more directly onto the data structures used in modern programming languages.
JSON is not extensible because it does not need to be. JSON is not a document markup language, so it is not necessary to define new tags or attributes to represent data in it.
JSON has the same interoperability potential as XML.
JSON is at least as open as XML, perhaps more so because it is not in the center of corporate/political standardization struggles.
XML is human readable
JSON is much easier for human to read than XML. It is easier to write, too. It is also easier for machines to read and write.
XML can be used as an exchange format to enable users to move their data between
The same is true for JSON.
XML provides a structure to data so that it is richer in information
The same is true for JSON.
XML is easily processed because the structure of the data is simple and standard
JSON is processed more easily because its structure is simpler.
There is a wide range of reusable software available to programmers to handle
XML so they don't have to re-invent code
XML separates the presentation of data from the structure of that data.
XML requires translating the structure of the data into a document structure. This mapping can be complicated. JSON structures are based on arrays and records. That is what data is made of. XML structures are based on elements (which can be nested), attributes (which cannot), raw content text, entities, DTDs, and other meta structures.
A common exchange format
JSON is a better data exchange format. XML is a better document exchange format. Use the right tool for the right job.
Many views of the one data
JSON does not provide any display capabilities because it is not a document markup language.
XML and JSON have this in common.
Complete integration of all traditional databases and formats
(Statements about XML are sometimes given to a bit of hyperbole.) XML documents can contain any imaginable data type - from classical data like
text and numbers, or multimedia objects such as sounds, to active formats like
Java applets or ActiveX components.
JSON does not have a <[CDATA]> feature, so it is not well suited to act as a carrier of sounds or images or other large binary payloads. JSON is optimized for data. Besides, delivering executable programs in a data-interchange system could introduce dangerous security problems.
XML and JSON both use Unicode.
Open and extensible
XML’s one-of-a-kind open structure allows you to add other state-of-the-art
elements when needed. This means that you can always adapt your system to embrace
Those vocabularies can be automatically converted to JSON, making migration from XML to JSON very straightforward.
XML is easily readable by both humans and machines
JSON is easier to read for both humans and machines.
XML is object-oriented
Actually, XML is document-oriented. JSON is data-oriented. JSON can be mapped more easily to object-oriented systems.
XML is being widely adopted by the computer industry
JSON is just beginning to become known. Its simplicity and the ease of converting XML to JSON makes JSON ultimately more adoptable.
What Does JSON Look Like?
- Here's information about a person, his website, and his email, all structured as JSON:
How is the Data in JSON Extracted?
- Very easy: (suppose the variable "data" holds the above JSON data)
data.id returns "001"