Member-only story
JSON vs BSON
JSON and BSON are close cousins, as their nearly identical names imply, but you wouldn’t know it by looking at them side by side. JSON, or JavaScript Object Notation, is the wildly popular standard for data interchange on the web, on which BSON (Binary JSON) is based. We’ll take a look at each, and hopefully shed some light on the JSON vs. BSON mystery:
What is JSON?
JSON, or JavaScript Object Notation, is a human-readable data interchange format, specified in the early 2000s. Even though JSON is based on a subset of the JavaScript programming language standard, it’s completely language-independent.
JSON objects are associative containers, wherein a string key is mapped to a value (which can be a number, string, boolean, array, an empty value — null, or even another object).
{
"_id": 1,
"name": { "first" : "John", "last" : "Backus" },
"contribs": [ "Fortran", "ALGOL", "Backus-Naur Form", "FP" ],
"awards": [
{
"award": "W.W. McDowell Award",
"year": 1967,
"by": "IEEE Computer Society"
}, {
"award": "Draper Prize",
"year": 1993,
"by": "National Academy of Engineering"
}
]
}What is BSON?
BSON stands for “Binary JSON,”. BSON’s binary structure encodes type and length information, which allows it to be traversed much more quickly compared to JSON.
BSON adds some non-JSON-native data types, like dates and binary data, without which MongoDB would have been missing…





