Protocols
Saved & recent

Concise Binary Object Representation

Also called: CBOR, RFC 8949

CBOR is a binary format for structured data, including integers, byte strings, text strings, arrays and maps. Encoded type information lets a decoder recognize these basic shapes without a separate schema. An application still needs a contract explaining what its fields mean and which values are acceptable.

For example, the array [1, 2, 3] can be encoded as the hexadecimal bytes 83 01 02 03: the first byte announces a three-element array, followed by the small integers. CBOR also supports tags that add agreed interpretation to values. Its compact representation does not provide encryption or automatically make two applications agree about the meaning of the data.

Read first
Serialization
Related
Serialization, MessagePack, Canonicalization
Further reading
IETF — RFC 8949, CBOR
[1, 2, 3] 83 01 02 03 array of 3 items integer 1 integer 2 integer 3 array · integers meaning from context decoder knows types application knows meaning hexadecimal byte cells
CBOR encodes this three-integer array in four bytes; application meaning still comes from a shared contract.

View in the full Protocols collection