JSON is how most websites and apps send data to each other.
Direct answer
JSON (JavaScript Object Notation) is a text format for data made of key-value pairs, lists, strings, numbers, booleans and null. In JavaScript, JSON.parse() turns JSON text into an object and JSON.stringify() turns an object into JSON text.
Example
{
"name": "Ada",
"age": 28,
"skills": ["math", "code"],
"active": true
}
Rules
- Keys must be in double quotes.
- Strings use double quotes, not single.
- No trailing commas.
- No comments.
In JavaScript
const text = '{"name":"Ada","age":28}';
const obj = JSON.parse(text);
console.log(obj.name); // Ada
const back = JSON.stringify(obj);
Common mistakes
- Using single quotes.
- Leaving a trailing comma.
- Trying to parse something that is already an object.
Where Teyro fits
Teyro's JavaScript for Beginners course turns this into short lessons you can play in a few minutes a day. It has 50 lessons, and you can start free.
The bottom line
JSON is simple, readable and everywhere. Learn the rules once and you can read most APIs.


