Loading content...
Loading content...
JSON (JavaScript Object Notation) is the universal data interchange format of modern web APIs. Master the 6 valid JSON data types, strict syntax rules (double quotes, no trailing commas), the serialization roundtrip (JSON.stringify() and JSON.parse()), and how frontend fetch() exchanges JSON payloads with backend databases.
A lightweight, text-based data interchange format independent of any single programming language
JSON (JavaScript Object Notation) is a standardized text format for serializing structured data. Despite its name, JSON is completely language-independent: Python, Java, Go, Ruby, and PHP can all parse and generate JSON with zero friction.
{ name: "Alex", price: 2500 }.JSON.stringify() to turn the object into a text string.Content-Type: application/json.200 OK.await response.json() and updates the DOM view.Understanding the exact primitives supported by the standard
| JSON Type | Syntax Rules | Example | Notes |
|---|---|---|---|
| String | Must use double quotes ("") | "Mechanical Keyboard" | Single quotes are illegal in JSON |
| Number | Integer, float, or scientific (1e4) | 2500, -12.5 | No NaN or Infinity |
| Boolean | Lowercase true or false | true, false | Case-sensitive |
| Null | Represents null value | null | Replaces undefined |
| Object | { "key": value } | {"id": 42} | Keys must be double-quoted |
| Array | [ value1, value2 ] | [1, 2, 3] | Ordered collection of values |
undefined • function() • Date • BigInt • Symbol • Map • Set.JSON.stringify(), functions and undefined are silently stripped from objects, while BigInt throws a fatal TypeError!Runtime memory representation vs. serialized text format
const user = {
name: 'Alex', // Single quotes OK
age: 25, // Unquoted keys OK
active: undefined, // undefined allowed
greet: () => {} // Functions allowed
};Lives in JavaScript engine memory. Supports functions, symbols, and flexible syntax.
{
"name": "Alex", // Double quotes mandatory
"age": 25, // Keys must be strings
"active": null // null, NO undefined
// NO comments, NO functions allowed
}A raw text string sent over HTTP wires. Strict universal syntax parsed by any language.
Edit, validate, and beautify JSON payloads with real-time syntax checking
Match each JSON value snippet to its official RFC 8259 data type
"Mechanical Keyboard"2500truenull["Python", "SQL"]{"name": "Alex"}Diagnose and repair the 5 most common syntax errors found in web API communication
Learn how frontend JavaScript accesses nested JSON array and object structures
Click on any property below to see its exact JavaScript accessor path:
Discover what happens to undefined, functions, and Date objects during serialization
{
"name": "Keyboard",
"price": 2500,
"inStock": true
}Validate the JSON exchange contract for an e-commerce checkout flow
Critical mistakes that cause API parsing failures
"". Single quotes 'name' will throw a SyntaxError.{"a": 1, "b": 2,} is invalid in JSON.{"age": "hello"} is valid JSON, but still invalid application data. Always validate data schemas.Validate your understanding of JSON types, syntax, and serialization
Test your mastery of JSON data types, serialization rules, syntax requirements, and API communication.
Which of the following value types is NOT supported natively by the JSON standard (RFC 8259)?
Core concepts you have mastered in this module