# Overview Though JSON is a ubiquitous data format, it is not a very compact format suitable for data exchange, for instance over a network. Hence, the library supports - [BSON](bson.md) (Binary JSON), - [CBOR](cbor.md) (Concise Binary Object Representation), - [MessagePack](messagepack.md), and - [UBJSON](ubjson.md) (Universal Binary JSON) to efficiently encode JSON values to byte vectors and to decode such vectors. ## Comparison ### Completeness | Format | Serialization | Deserialization | | ----------- |---------------------------------------------- | -------------------------------------------- | | BSON | incomplete: top-level value must be an object | incomplete, but all JSON types are supported | | CBOR | complete | incomplete, but all JSON types are supported | | MessagePack | complete | complete | | UBJSON | complete | complete | ### Binary values | Format | Binary values | Binary subtypes | | ----------- | ------------- | --------------- | | BSON | supported | supported | | CBOR | supported | not supported | | MessagePack | supported | supported | | UBJSON | not supported | not supported | See [binary values](../binary_values.md) for more information. ### Sizes | Format | canada.json | twitter.json | citm_catalog.json | jeopardy.json | | ------------------ | ----------- | ------------ | ----------------- | ------------- | | BSON | 85,8Â % | 95,2Â % | 95,8Â % | 106,7 % | | CBOR | 50,5Â % | 86,3Â % | 68,4Â % | 88,0Â % | | MessagePack | 50,6Â % | 86,0Â % | 68,5Â % | 87,9Â % | | UBJSON | 53,2Â % | 91,3Â % | 78,2Â % | 96,6Â % | | UBJSON (size) | 58,6Â % | 92,3Â % | 86,8Â % | 97,4Â % | | UBJSON (size+type) | 55,9Â % | 92,3Â % | 85,0Â % | 95,0Â % | Sizes compared to minified JSON value.