JSON Quiz
Test your knowledge of the JSON format. — 8 questions
About the JSON Quiz
Test your knowledge of the JSON format. This quiz has 8 multiple-choice questions. Each question has one correct answer, and you see an explanation straight after you answer, so you learn from every question — including the ones you get wrong. There is no time limit and nothing to sign up for; your answers are not stored.
The questions follow the material in the JSON Basics guide and the JSON cheatsheet. Read them first if you want to prepare, or take the quiz cold to find the gaps in what you know.
Questions in this quiz
Preview the questions below. Each answer and its explanation are hidden until you choose to reveal them, so you can still take the quiz above without spoilers.
1. Which of the following is valid JSON?
Show answer
Answer: C. { "name": "Alice" }
JSON requires double-quoted keys and string values. Single quotes and unquoted identifiers are not valid.
2. Which data type does NOT exist in JSON?
Show answer
Answer: C. undefined
JSON has no `undefined` type. It supports string, number, boolean, null, array, and object only.
3. Are trailing commas allowed in JSON?
Show answer
Answer: C. No, never
Trailing commas are not valid JSON. { "a": 1, } will cause a parse error.
4. What does JSON stand for?
Show answer
Answer: B. JavaScript Object Notation
JSON stands for JavaScript Object Notation, though it is language-independent.
5. What is a valid JSON root value?
Show answer
Answer: C. Can be any valid JSON value
A JSON document can have any valid value at its root: object, array, string, number, boolean, or null.
6. How is null represented in JSON?
Show answer
Answer: C. null
In JSON, null is written as the bare keyword null (no quotes, lowercase).
7. Which is a valid JSON number?
Show answer
Answer: D. 3.14
JSON does not support NaN, Infinity, or hex literals. Only standard decimal numbers like 3.14 are valid.
8. In a JSON object, can two keys have the same name?
Show answer
Answer: B. Yes, the last value wins (by convention)
The JSON spec technically allows duplicate keys but considers it undefined behavior. Most parsers keep the last value, but it should be avoided.
How to use this quiz
- Answer every question before reading the explanations below — retrieving an answer from memory is what makes it stick.
- Note the questions you missed and revisit the matching section of the guide or cheatsheet.
- Retake the quiz a day or two later. Spaced repetition is one of the most reliable ways to remember technical details.