---
title: "Why Use JSON over XML"  
description: "Why Use JSON over XML"  
author: "AVADHESH PATEL"  
published: 2013-06-06  
updated: 2020-09-21  
canonical: https://www.mindstick.com/interview/1756/why-use-json-over-xml  
category: "json"  
tags: ["json"]  
reading_time: 1 minute  

---

# Why Use JSON over XML

## Lighter and faster than XML as on-the-wire data format

JSON objects are typed while XML data is typeless \
JSON types: string, number, array, boolean,\
XML data are all string\
Native data form for JavaScript code\
Data is readily accessible as JSON objects in your JavaScript\
code vs. XML data needed to be parsed and assigned to variables through tedious DOM APIs\
Retrieving values is as easy as reading from an object property in your JavaScript code

## Answers

### Answer by AVADHESH PATEL

## Lighter and faster than XML as on-the-wire data format

JSON objects are typed while XML data is typeless \
JSON types: string, number, array, boolean,\
XML data are all string\
Native data form for JavaScript code\
Data is readily accessible as JSON objects in your JavaScript\
code vs. XML data needed to be parsed and assigned to variables through tedious DOM APIs\
Retrieving values is as easy as reading from an object property in your JavaScript code


---

Original Source: https://www.mindstick.com/interview/1756/why-use-json-over-xml

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
