JSON playground

Knowledge Videos

Short animated explainers, organised by subject.

JSON playground

Type JSON and see if it is valid, what it describes, how JavaScript reaches each value, and what the mistake is.

JSON is a way of writing data as text. It uses the same square brackets for arrays and curly brackets for objects that you know from JavaScript, but it is stricter: names and text need double quotes, and there is no comma after the last item.

JSON.parse turns JSON text into an array or object you can use, and JSON.stringify turns it back into text. If the text is not valid JSON, JSON.parse stops with an error.

Things to try

From the videos