Serialization means wire shape
The same message meaning can be carried as text, tagged binary values, numbered fields, or a fixed byte layout.
Compare JSON, MessagePack, CBOR, Protocol Buffers, Avro, and raw binary for IoT payloads
Compare how the same IoT message changes when it is encoded as readable JSON, compact binary JSON, schema-based bytes, or a fixed raw packet. The animation shows byte cost, airtime, debugging value, and schema trade-offs together.
The same message meaning can be carried as text, tagged binary values, numbered fields, or a fixed byte layout.
JSON repeats keys such as temperature. Binary and schema formats avoid part of that overhead.
Protobuf and Avro can be compact, but both sides must agree on field numbers, types, and evolution rules.
A few dozen bytes may not matter on Wi-Fi, but they can dominate airtime and battery on LPWAN links.
Start with the fields and values.
JSON keeps names and punctuation.
MessagePack and CBOR shorten the shape.
Protobuf and Avro replace names with schema rules.
Convert bytes into airtime on a real link.
Pick the format that matches the constraint.
Read the source message before comparing wire formats.
Serialization changes representation, not the sensor meaning.
Readable keys help humans debug but add bytes to every message.
Use Step or Play to walk through the comparison.
The JSON sketch is literal UTF-8. Binary sketches are representative teaching sketches, not a substitute for measuring your exact library and schema.
Switch the message, link, and priority to see why the best format changes.
These are teaching estimates designed to show direction and trade-off. For production, measure the exact encoder, schema, field values, and protocol framing you use.
payload_bytes = encoded_message_length
JSON bytes = UTF-8 length of minified JSON
JSON includes quotes, punctuation, and field names in every message.
airtime_ms = payload_bytes * 8 / link_bps * 1000
daily_MB = bytes * msgs_per_hour * devices * 24 / 1e6
Serialization cost is only payload cost; protocol headers are a separate layer.
best_format = max(priority_weighted_score)
score uses size, debugging, ecosystem, schema, and fit
There is no universal winner. The correct choice depends on the constraint.
Use these cards to check vocabulary, format behavior, and the limits of this simplified comparison.