What is JSON? Complete Beginner's Guide

Understanding JavaScript Object Notation - the world's most popular data format

Published: January 2025 • 8 min read

JSON (JavaScript Object Notation) is a lightweight text format for storing and exchanging data between computers. If you've ever used a website or mobile app, you've interacted with JSON without even knowing it. It's the invisible language that powers modern web applications.

JSON is human-readable, easy to write, and supported by virtually every programming language. Whether you're a developer building APIs or just curious about how data moves across the internet, understanding JSON is essential. Learn how to create JSON files or open existing ones.

What Does JSON Stand For?

JSON stands for JavaScript Object Notation. Despite the name, JSON is language-independent and can be used with Python, Java, C#, PHP, Ruby, and virtually every modern programming language.

Key Point: JSON was derived from JavaScript, but it's now a universal data format used across all programming languages and platforms.

A Simple JSON Example

JSON data is written as name/value pairs, similar to how you might write information on a form. Here's a simple example:

{
  "name": "Network Device",
  "ipAddress": "192.168.1.100",
  "port": 8080,
  "isActive": true,
  "protocols": ["HTTP", "HTTPS", "FTP"]
}

This JSON object describes a network device with five properties:

  • name - text (string)
  • ipAddress - text (string)
  • port - number
  • isActive - true/false (boolean)
  • protocols - list of values (array)

JSON Data Types

JSON supports six basic data types that cover most data representation needs:

1. String

Text enclosed in double quotes.

"hostname": "server-01.network.com"

2. Number

Integer or decimal values without quotes.

"bandwidth": 1000, "latency": 23.5

3. Boolean

True or false values.

"isOnline": true, "maintenanceMode": false

4. Array

Ordered list of values in square brackets.

"dns": ["8.8.8.8", "8.8.4.4"]

5. Object

Collection of name/value pairs in curly braces.

"connection": {
  "type": "ethernet",
  "speed": "1Gbps"
}

6. Null

Represents an empty or unknown value.

"backup": null

Why Developers Use JSON

1. Human-Readable

Unlike binary formats, you can open a JSON file in any text editor and immediately understand the data structure.

2. Lightweight

JSON has minimal syntax overhead, making it efficient for data transmission over networks.

3. Language-Independent

Every major programming language has built-in support for reading and writing JSON.

4. Easy to Parse

Converting JSON to native programming objects is straightforward and fast.

5. Web-Friendly

JSON is the native data format for JavaScript, making it perfect for web applications and REST APIs.

Real-World Use Cases

JSON is used everywhere in modern technology. Here are common scenarios:

Web APIs

REST APIs use JSON to send data between servers and clients. When you load a web page, JSON delivers the data.

Configuration Files

Applications store settings in JSON files (e.g., package.json in Node.js projects).

Data Storage

NoSQL databases like MongoDB store records as JSON documents.

Mobile Apps

iOS and Android apps communicate with backend servers using JSON.

JSON Syntax Rules

JSON has strict formatting rules. Follow these to create valid JSON:

  • 1.Data is in name/value pairs: "name": "value"
  • 2.Names (keys) must be enclosed in double quotes
  • 3.Values must be valid JSON data types (string, number, boolean, array, object, null)
  • 4.Pairs are separated by commas
  • 5.Objects are enclosed in curly braces { }
  • 6.Arrays are enclosed in square brackets [ ]
  • 7.No trailing commas allowed
  • 8.Comments are NOT supported in standard JSON

Useful JSON Tools

Working with JSON is easier with the right tools. Here are some helpful resources:

Continue Learning

External References