MQTT data budget
Before you pick a SIM plan for a fleet of devices, count the bytes. Paste a real payload, choose how the device connects, and see where every byte goes.
28 bytes as UTF-8. Paste a real message for a real answer.
A ping is sent only when nothing else went out within this time.
- Per message
- 573B
- Payload share
- 5%
- Per device, 30 days
- 4.95MB
- Fleet of 50, 30 days
- 248MB
Where the bytes of one message go
- Your payload28 B
- MQTT headers and acks41 B
- TLS records44 B
- TCP/IP headers156 B
- Connecting and keep-alive304 B
288 messages a day per device, 165 KB a day. Counted the way a mobile data plan counts: every IP byte, both directions.
How it works
The PUBLISH packet is sized from the MQTT wire format: a fixed header, a variable-length remaining-length field, the topic with its two-byte length, a packet identifier at QoS 1 and 2, a property length in MQTT 5, then your payload.
publish = 1 + len(remaining length) + 2 + topic + packet id + payload per send = publish + acks + TLS record overhead + TCP/IP headers per month = per send × messages per day × 30
Each segment carries about 52 bytes of IPv4 and TCP headers with timestamps, and each TLS record adds 22 bytes in TLS 1.3 or 29 in TLS 1.2 with AES-GCM. Every packet sent is acknowledged by a TCP ACK coming back.
Reconnecting each time adds the TCP open and close, the MQTT CONNECT and DISCONNECT, and a TLS handshake. The handshake presets are typical sizes; most of a full handshake is the server’s certificate chain.
What it leaves out
A persistent connection’s first handshake is not counted; it is spread over every message that follows.
Retransmissions on a weak signal, DNS lookups and NTP time sync are not included.
Operators round sessions differently. Treat the result as a floor, and leave headroom on the plan.
