What Is JSON? A Beginner’s Guide with Examples
Understand JSON — the format that powers nearly every web API — in a few minutes, with clear examples.
JSON (JavaScript Object Notation) is a lightweight, human-readable way to store and exchange data. It powers almost every modern web and mobile app behind the scenes.
What JSON looks like
{
"name": "Ada",
"age": 30,
"skills": ["design", "code"],
"active": true
}
That is it: keys in quotes, paired with values, separated by commas, wrapped in curly braces.
The data types
- String — text in double quotes:
"hello" - Number —
42or3.14 - Boolean —
trueorfalse - Array — an ordered list in square brackets:
[1, 2, 3] - Object — nested key/value pairs in curly braces
- null — an empty value
Common mistakes
- Trailing commas after the last item (not allowed in JSON).
- Single quotes instead of double quotes.
- Keys without quotes.
When JSON breaks, a formatter shows you exactly where. Paste yours into our JSON formatter to beautify it, minify it, or find the error instantly — all in your browser.
Frequently asked questions
Is JSON only for JavaScript?
No. Despite the name, every major language reads and writes JSON. It is a universal data format.
JSON vs XML — which is better?
JSON is lighter and easier to read, which is why most modern APIs prefer it. XML is still used where its extra features are needed.