The story behind the JSON formatter

JSON is the format most web APIs speak today, yet it was never designed by a committee. It was noticed rather than invented: a small subset of JavaScript that turned out to be just enough to move data between programs.

Curly braces and nested data blocks forming a glowing tree
Curly braces and nested data blocks forming a glowing tree

A format that was discovered

Around 2001 Douglas Crockford and his colleagues at State Software needed a way for a browser and a server to exchange data without plugins. They used the object and array literals JavaScript already understood, gave the idea a name and put the grammar on json.org, famously short enough to fit on the back of a business card.

Why there are no comments

Early on, Crockford removed comments from JSON because people were starting to put parsing directives inside them, which would have broken interoperability. His advice was to strip comments with a minifier before parsing. That is why a formatter reports a comment as an unexpected character, and why formats such as JSON5 and JSONC exist for configuration files.

From a web page to a standard

JSON was first described as RFC 4627 in 2006. Ecma published ECMA-404 in 2013, and the IETF replaced the older texts with RFC 8259 in 2017, which requires UTF-8 for JSON exchanged between systems. The grammar has barely changed since json.org: objects, arrays, strings, numbers, true, false and null.

Numbers and paths

JSON itself puts no limit on numbers, but most parsers store them as 64 bit floating point values, so integers above 9007199254740991 can silently lose precision. Large IDs are therefore often sent as strings. For pointing at a value, Stefan Goessner proposed JSONPath in 2007, borrowing from XPath, and it became the standard RFC 9535 in 2024. The paths this formatter copies follow that dollar and bracket notation.

Frequently asked questions

Who invented JSON?

Douglas Crockford specified and popularised JSON in the early 2000s, although he says he discovered it, because it is a subset of JavaScript that already existed.

Why does JSON not allow trailing commas or single quotes?

The grammar was kept as small as possible so that every language could parse it the same way. Each extra convenience would be another chance for two parsers to disagree.

Is JSON the same as a JavaScript object?

No. JSON is text. Keys must use double quotes, and functions, undefined, comments, NaN and Infinity are not allowed, even though JavaScript accepts them in code.

Ready to try it?

Open PictorX in your browser — no install, no credit card required to start.

Open the JSON formatter