MongoDB stores data as BSON (Binary JSON) — a superset of JSON that adds richer type information and encodes data in binary for efficiency.
| Feature | JSON | BSON |
|---|---|---|
| Format | Human-readable text (UTF-8) | Binary — not human-readable |
| Numbers | Single generic "Number" type | Int32, Int64, Double, Decimal128 |
| Dates | Strings (no native Date type) | Native 64-bit UTC timestamp |
| Binary | Base64 encode workaround | Native BinData type |
| ObjectId | Not available | Native 12-byte type |
| Speed | Slower (text parsing) | Faster (binary traversal) |
| Size | Smaller for simple strings | Smaller for typed numeric data |
The MongoDB wire protocol and storage both use BSON. When you use the shell or a driver, it serializes your JavaScript objects to BSON and deserializes responses from BSON transparently.