The MQTT Reason Codes Reference is a searchable lookup for the single-byte
reason codes introduced in MQTT 5.0. Unlike MQTT 3.1.1, which had a tiny set of
CONNACK return codes, version 5.0 uses a unified reason-code byte across nearly
every acknowledgement and the DISCONNECT and AUTH packets — so the same 0x87 can
explain a refused connect, a blocked publish, or a denied subscribe.
How it works
Every MQTT 5.0 control packet that reports a result carries a one-byte reason code. The high bit splits the range cleanly:
0x00 - 0x7F Success / normal operation
0x80 - 0xFF Error / failure
Acknowledgement packets — CONNACK, PUBACK, PUBREC, PUBREL, PUBCOMP,
SUBACK, UNSUBACK — plus DISCONNECT and AUTH each return one. The label
attached to a value can vary by packet: 0x00 is Success in CONNACK,
Granted QoS 0 in SUBACK, and Normal disconnection in DISCONNECT. This tool
keeps the full table in your browser and filters it by hex value, decimal value,
name, packet type or description.
Example and tips
A clean session looks like CONNECT → CONNACK 0x00 Success →
SUBSCRIBE → SUBACK 0x01 Granted QoS 1 → PUBLISH →
PUBACK 0x00 Success. Watch the success-range informational codes: 0x10 (no
matching subscribers) and 0x11 (no subscription existed) are not errors, so
don’t alert on them. On the error side, a server can now send a DISCONNECT
to the client with a reason such as 0x8D (Keep Alive timeout), 0x8E
(Session taken over) or 0x95 (Packet too large) — read that byte to learn why
the broker dropped you rather than guessing.