JSON Studio

What Is JSON?

Learn what JSON (JavaScript Object Notation) is, how it works, its syntax rules, data types, and why it's the most popular data format for web APIs and configuration files.

JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format. Despite its name, JSON is language-independent and supported by virtually every programming language — Python, Java, Go, Rust, C#, Ruby, PHP, and dozens more.

JSON Syntax

A JSON document is built from two structures:

ObjectsUnordered collections of key-value pairs wrapped in curly braces `{}`

ArraysOrdered lists of values wrapped in square brackets `[]`

{
  "name": "Alice",
  "age": 28,
  "isActive": true,
  "skills": ["TypeScript", "Go", "Rust"],
  "address": {
    "city": "San Francisco",
    "zip": "94110"
  }
}

JSON Data Types

JSON supports exactly six data types:

TypeExampleNotes
String"hello"Must use double quotes
Number42, 3.14No leading zeros, no hex/octal
Booleantrue, falseLowercase only
NullnullRepresents absence of value
Object{"key": "value"}Keys must be double-quoted strings
Array[1, 2, 3]Can contain mixed types

Where Is JSON Used?

REST APIsThe default response format for 95%+ of web APIs

Configuration files`package.json`, `tsconfig.json`, VS Code settings

NoSQL databasesMongoDB, CouchDB, Firebase store data as JSON documents

Message queuesKafka, RabbitMQ, SQS payloads are typically JSON

LoggingStructured logging with JSON (ELK Stack, CloudWatch, Datadog)

JSON vs XML

JSON replaced XML as the dominant data interchange format because it's more concise, easier to read, and natively supported by JavaScript. An equivalent XML document is typically 2-3x larger than its JSON counterpart.

Try It Yourself

Use our JSON Formatter to beautify and validate JSON instantly, or our JSON Viewer to explore nested structures as a collapsible tree.

J

Written by JSON Studio

Engineering Team