What is JSON? A Complete Guide

5 min read
json basics guide

What is JSON?

JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format. Despite its name, JSON is language-independent — virtually every modern programming language has built-in support for reading and writing it.

JSON Syntax

JSON is built on two structures:

  1. Objects — A collection of key/value pairs enclosed in curly braces {}
  2. Arrays — An ordered list of values enclosed in square brackets []
{
  "name": "Alice",
  "age": 30,
  "isAdmin": false,
  "scores": [95, 87, 92],
  "address": {
    "city": "Istanbul",
    "country": "Turkey"
  }
}

Data Types

JSON supports exactly six data types:

TypeExample
String"hello world"
Number42, 3.14, -7
Booleantrue, false
Nullnull
Object{ "key": "value" }
Array[1, 2, 3]

Why Use JSON?

  • Human-readable — Easy to read and write
  • Compact — Less verbose than XML
  • Universal — Supported by every major language and platform
  • Native to JavaScript — Parsed directly with JSON.parse() and serialized with JSON.stringify()

JSON vs Other Formats

JSON has largely replaced XML for web APIs due to its simplicity. Compared to CSV, JSON supports nested structures and mixed data types.

Ready to work with JSON? Try our JSON Beautifier to format your JSON instantly.