JSON vs XML- What is the basic difference between JSON and XML

Golap Gunjan Barman
2 min readMar 22, 2021

JSON vs XML- What is the basic difference between JSON and XML.

What is JSON?

JSON is used to store information in an organized, and easy-to-access manner. Its full form is JavaScript Object Notation. It offers a human-readable collection of data that can be accessed logically. Extension of XML file is .json

What is XML?

XML is a markup language that is designed to store data. It’s popularly used for the transfer of data. It is case-sensitive. XML offers you to define markup elements and generate customized markup language. The basic unit in the XML is known as an element. Extension of XML file is .XML

JSON vs XML

JSON object has a type.

And XML data is typeless.

……..

JSON types: string, number, array, Boolean.

And All XML data should be the string.

……..

Data is readily accessible as JSON objects.

And XML data needs to be parsed.

……..

JSON is supported by most browsers.

And Cross-browser XML parsing can be tricky.

……..

JSON has no display capabilities.

And XML offers the capability to display data because it is a markup language.

……..

JSON supports only text and number data types.

And XML supports various data types such as numbers, text, images, charts, graphs, etc. It also provides options for transferring the structure or format of the data with actual data.

……..

In JSON Retrieving value is easy.

And in XML Retrieving value is difficult.

……..

JSON supported by many Ajax toolkits.

And XML is not fully supported by the Ajax toolkit.

……..

JSON is a fully automated way of deserializing/serializing JavaScript.

And in XML developers have to write JavaScript code to serialize/de-serialize from XML

……..

Native support for object.

And The object has to be express by conventions — mostly missed the use of attributes and elements.

……..

JSON supports only UTF-8 encoding.

And XML supports various encoding.

……..

JSON doesn’t support comments.

And XML supports comments.

……..

JSON files are easy to read as compared to XML.

And XML documents are relatively more difficult to read and interpret.

……..

JSON does not provide any support for namespaces.

And XML supports namespaces.

……..

JSON is less secured.

And XML is more secure than JSON.

……..

JSON is easy to learn.

XML is less easy than JSON.

……..

JSON is data-oriented.

XML is document-oriented.

……..

JSON doesn’t provide display capabilities.

XML provides the capability to display data because it is a markup language.

……..

JSON supports array.

XML doesn’t support the array.

……..

You can follow me on YouTube:

Golap Barman

Also, visit my website for more content like this

www.gbandroidblogs.com

Follow me on Instagram

Android App Developer

Follow me on Facebook

GBAndroidBlogs

--

--

Golap Gunjan Barman

Hi everyone, myself Golap an Android app developer with UI/UX designer.