JSON Cheatsheet 2025

The complete reference guide for JSON syntax, data types, and best practices. Bookmark this page for quick reference.

No data uploaded – runs 100% in your browser
Used by developers in 120+ countries
v2025.1 • Updated Nov 2025
Leaderboard Ad

What is JSON?

JSON (JavaScript Object Notation) is a lightweight data interchange format that's easy for humans to read and write, and easy for machines to parse and generate. It's the most common format for APIs and configuration files.

JSON Syntax Rules

  • Data is in name/value pairs
  • Data is separated by commas
  • Curly braces hold objects
  • Square brackets hold arrays
  • String values must use double quotes (not single quotes)
  • No trailing commas allowed
  • No comments allowed in standard JSON

JSON Data Types

TypeExampleDescription
string"hello"Text in double quotes
number42, 3.14, -1Integer or floating point
booleantrue, falseLowercase only
nullnullEmpty/no value
object{"key": "value"}Key-value pairs in braces
array[1, 2, 3]Ordered list in brackets

JSON Object Example

{
  "name": "John Doe",
  "age": 30,
  "email": "john@example.com",
  "isActive": true,
  "address": {
    "street": "123 Main St",
    "city": "New York",
    "zip": "10001"
  },
  "hobbies": ["reading", "gaming", "hiking"]
}

Common JSON Mistakes

  • Single quotes: Use "string" not 'string'
  • Trailing commas: [1, 2, 3,] is invalid
  • Unquoted keys: Use {"key": 1} not {key: 1}
  • Comments: JSON doesn't support // comments
  • Undefined: Use null instead of undefined

JSON vs JavaScript Objects

JSON is a subset of JavaScript object syntax, but with stricter rules:

  • JSON requires double quotes for strings and keys
  • JSON doesn't allow functions, dates, or undefined
  • JSON doesn't allow trailing commas
  • JSON doesn't allow comments

JSON Schema Validation

JSON Schema is a vocabulary for validating JSON data. It lets you define the structure, types, and constraints for your JSON:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": { "type": "string" },
    "age": { "type": "integer", "minimum": 0 }
  },
  "required": ["name"]
}

JSON Tools You'll Need

Multiplex Ad

Related Resources