Message Serialization Comparator

Compare IoT message formats by bytes, airtime, parsing work, and schema risk

animation
serialization
json
messagepack
protobuf
cbor
avro
binary
iot
Interactive IoT message serialization comparator with payload size estimates, link airtime, schema trade-offs, format scoring, and responsive encode-transmit-decode animation.
IoT data Payload bytes Schema risk Airtime

Message Serialization Comparator

Watch the same sensor report move through encoding, transmission, decoding, and platform use while the comparator scores JSON, CBOR, MessagePack, Protocol Buffers, Avro, and raw binary against IoT constraints.

CBOR Recommended format
86 B Selected payload
2.3 s Link airtime

Payload shape

More fields, longer keys, and repeated readings change text and binary formats differently.

Wire cost

Bytes become airtime and daily fleet volume once link speed and report rate are known.

Runtime cost

Text parsing, schema libraries, RAM buffers, and compression all matter on small devices.

Lifecycle risk

Schema evolution, debugging, and ecosystem support can outweigh the smallest payload.

Encode -> transmit -> decode

Encoding sensor report

Field names, type markers, tags, and fixed layouts decide what actually crosses the network.

Teaching estimate
Serialization pipeline A packet moves through shape, encode, transmit, decode, and operate stages while estimates update. Shape 6 fields Encode type markers Transmit airtime Decode parse work Decide trade-off Message sketch { id, ts, temp, battery } Selected format CBOR Why it matters fits constrained links CBOR 86 B
CBOR 86 B
1 Shape6 fields
2 Encodebinary tags
3 Transmitairtime
4 Decodeparse work
5 Decidetrade-off
a4 62 69 64 68 73 65 6e 73 2d 30 31 62 74 73 1a ... CBOR byte sketch
Technical Accuracy Notes
  • Byte counts are teaching estimates, not library conformance tests.
  • JSON uses UTF-8 text and normally repeats field names in every object.
  • CBOR and MessagePack can still carry map keys; using numeric keys becomes a schema decision.
  • Protocol Buffers and Avro assume sender and receiver share compatible schemas.
  • Raw binary is compact only when layout, byte order, versioning, and validation are controlled.
Guided Checks
  • Raise key length and compare JSON against schema-based formats.
  • Drop link speed below 1 kbps and watch airtime dominate the choice.
  • Enable optional future fields and notice why raw layouts become risky.
  • Turn on compression only after checking CPU and RAM trade-offs.
Formula Trace

airtime_ms = payload_bytes x 8 / link_kbps. Daily fleet MB uses decimal networking units: bytes x reports/min x 1440 x devices / 1,000,000.