Krivalar Tutorials 
Krivalar Tutorials

JSON-vs-XML


What is JSON? JSON_Syntax JSON_Data Types JSON_vs_XML JSON_Array JSON_Object

JSON is a JavaScript Object Notation. XML is an eXtensible Markup Language. Both JSON and XML can be used as data interchange formats. Many programming languages use this JSON or XML for data transfer between the client and the web server. Here, we list down the few differences between JSON and XML.

JSONXML
The JSON is defined as a lightweight data-interchange formatXML means Extensible Markup Language that is designed to carry the data over the network
JSON is extended from JavaScriptXML is extended from SGML
The type of format used in JSON is a data interchange The type of format used in XML is a markup language.
The JSON doesn't use both begin and end tags XML uses both begin and end tags for each element
The JSON supports an arrayThe XML doesn't support an array
To compared with XML, The JSON is less securedXML Provides more secured
The JSON is a data-orientedXML is a document oriented
The JSON is more efficient and processed faster than the XMLXML is less efficient and processed slower than JSON
The JSON file is shorter and easy for a human to read and writeThe XML documents are large and complex that is both human-readable and machine-readable
We save the JSON file with an extension of .jsonWe save the XML file with an extension of .xml
For example:

{
   "First_Name" : "Mano",
   "Last_Name" : "Ram",
   "Age" : 35
}

	
For example:

	<employee>
	  <First_Name> Mano </First_Name>
	  <Last_Name> Ram </Last_Name>
	  <Age> 35 </Age>
	</employee>
	

<< Previous - JSON Data Types

Next - JSON Array >>