JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format. Despite its name, JSON is language-independent and is used across many programming languages for data storage and transmission.
"hello"
42
, 3.14
true
or false
null
{"key": "value"}
[1, 2, 3]
{ "name": "John Doe", "age": 30, "isActive": true, "address": { "street": "123 Main St", "city": "Anytown" }, "hobbies": ["reading", "coding"], "spouse": null }
{name: "John"}
{"name": "John"}
{"name": "John",}
{"name": "John"}
{'name': 'John'}
{"name": "John"}
Text enclosed in double quotes. Supports escape sequences like \n
, \"
, \\
.
"Hello World" "Line 1\nLine 2" "Quote: \"Hello\""
Integer or floating-point number. Can be negative and use scientific notation.
42 -17 3.14159 1.23e-4
True or false values (lowercase only).
true false
Collection of key-value pairs enclosed in curly braces.
{ "firstName": "John", "lastName": "Doe", "age": 30 }
Ordered list of values enclosed in square brackets.
[1, 2, 3, 4, 5] ["apple", "banana", "orange"] [true, false, null]
Represents an empty or missing value.
null
Always use proper indentation and consistent spacing for better readability.
Use tools like our JSON formatter to validate syntax before using in production.
Avoid deeply nested structures when possible. Flat structures are easier to work with.
Choose descriptive, consistent naming conventions for your JSON keys.