Question:

What is JSON?

JSON stands for JavaScript Object Notation.

JSON is a lightweight data format for storing and exchanging data. It’s human-readable and easy for computers to parse. Most modern web applications use JSON when sending data between the server and the browser.

Here’s what JSON looks like:

{
  "name": "Alice",
  "age": 30,
  "email": "[email protected]",
  "interests": ["coding", "reading", "hiking"]
}

It uses curly braces for objects, square brackets for arrays, and simple key-value pairs. The syntax is actually valid JavaScript, which is why it works so naturally with web applications.

Before JSON became popular, XML was the standard way to exchange data on the web. Here’s that same data in XML:

<person>
  <name>Alice</name>
  <age>30</age>
  <email>[email protected]</email>
  <interests>
    <interest>coding</interest>
    <interest>reading</interest>
    <interest>hiking</interest>
  </interests>
</person>

XML is more verbose and harder to work with. JSON’s simplicity won out, and today it’s the de facto standard for web APIs.

When you use AJAX to fetch data from a server, that data is almost always in JSON format. When you call an API, you typically get JSON back. And when you’re building modern applications with frameworks like React or Vue, you’re constantly working with JSON.

You’ll see JSON everywhere in web development. API responses, configuration files (like package.json in Node.js projects), and data storage all commonly use JSON.

See also What is AJAX?

You might also like