Data structures & formats · reviewed in August 2026
JSON
JSON (JavaScript Object Notation) is a lightweight text format for representing structured data — objects, lists, strings, numbers, booleans — using brace-and-bracket syntax that's readable by both humans and machines. It's the standard format for exchanging data between web APIs.
import json
text = '{"name": "Ana", "active": true}'
data = json.loads(text)
print(data["name"])Frequently asked questions
How does JSON relate to Python dictionaries?
A JSON object maps almost one-to-one to a Python dictionary; the standard json module converts JSON to dictionaries/lists with json.loads and back to text with json.dumps.
Why do REST APIs use JSON?
Because it's lightweight, easy to read, and virtually every programming language has a library to parse it, making it a neutral format for systems built in different technologies to talk to each other.
Does JSON support comments or dates natively?
It doesn't allow comments, and has no native date type — dates are represented as strings (usually ISO 8601 format), and each system decides how to interpret them.