EN
Back to the archive

The encyclopedia · Software & IT · Technical decision · 2001–2017

JSON won because it was a subset of JavaScript, so every browser already parsed it.

Douglas Crockford took the JavaScript object and array literal syntax, published it free, and any browser's native JS engine became a ready-made JSON parser.

Douglas Crockford · State Software

the move

In the early 2000s, moving data between a web page and a server meant XML: robust and rich, but heavy, because browsers needed complex parsing and every extra character was bytes on the wire. Crockford wanted something a browser could digest instantly.

His answer was a strict subset of the JavaScript literal syntax — objects as name/value pairs, arrays, strings, numbers, booleans and null — with everything that could have side effects, such as assignment and invocation, forbidden. The result was data defined in the very language the browser was already running.

He registered json.org and published the grammar free, and the Internet Engineering Task Force later turned it into RFC 4627 and then RFC 7159 and RFC 8259, so all the languages that were not JavaScript had one canonical reference to implement.

Because the payload was valid JavaScript and every browser shipped a JS engine, the world's largest deployment target already contained a reader for it. APIs standardized around it, and it went on to become the wire format for web apps, databases, logs and configuration.

why it works

  • A browser can evaluate JSON's literals natively, so the client's default runtime needs no parser library.
  • The grammar was stripped to object, array and value declarations, so it is small, readable and fast to parse anywhere.
  • Crockford published it royalty-free, so no vendor gated who could use the format.
  • It became an RFC and an ECMA standard, giving non-JavaScript languages one interoperable definition.
the payoffModel format on browser languageclever

what transfers

A transport format wins when it reuses syntax the target platform already executes natively, so the client needs no new tooling to read it.

what came after

JSON became the default interchange format for web APIs and then for configuration, logs and events, displacing XML wherever the client was a browser or mobile app. Its object-and-array grammar was copied by a generation of config languages and data formats.

references

spotted an error? The archive wants to know.

same kind of clever