MQTT QoS Explained: Understanding QoS 0, 1, and 2

January 30, 2026

MQTT QoS Explained: Understanding QoS 0, 1, and 2

MQTT QoS Explained: Understanding QoS 0, 1, and 2

In the world of IoT, network conditions can be unpredictable. To ensure reliable messaging, the MQTT protocol includes a crucial feature called Quality of Service (QoS). QoS defines the guarantee of message delivery between a client and the MQTT broker.

Choosing the right QoS level is a critical design decision, as it involves a trade-off between reliability and overhead (latency, bandwidth, and device processing power).

QoS 0: At Most Once

This is the fastest and least reliable delivery method. The publisher sends the message once and does not wait for an acknowledgment. It's a "fire and forget" approach.

sequenceDiagram participant P as Publisher participant B as Broker participant S as Subscriber P->>B: PUBLISH (QoS 0) Note over P,B: No confirmation sent B->>S: PUBLISH (QoS 0) Note over B,S: No confirmation sent
  • Guarantee: The message is delivered at most once, or not at all.
  • Use Case: Ideal for non-critical, high-frequency sensor data where losing an occasional message is acceptable. Think of an ESP32 temperature sensor reporting every second. If one reading is missed, the next one will arrive shortly.

QoS 1: At Least Once

This level guarantees that the message will be delivered at least once. The sender stores the message and re-sends it until it receives a PUBACK (Publish Acknowledgment) packet from the receiver.

sequenceDiagram participant P as Publisher participant B as Broker P->>B: PUBLISH (QoS 1, Packet ID 123) Note over P: Store message until acknowledged B-->>P: PUBACK (Packet ID 123) Note over P: Discard stored message
  • Possible Issue: The receiver might get the message, but the sender doesn't receive the acknowledgment. The sender then resends the message, leading to duplicates. The receiving application must be designed to handle this.
  • Use Case: Good for important commands where you must ensure receipt, such as in a smart home system. For example, sending a command to turn a light on.

QoS 2: Exactly Once

This is the most reliable but slowest method. It uses a four-part handshake to ensure the message is delivered exactly once, which is a core part of the publish-subscribe model.

sequenceDiagram participant P as Publisher participant B as Broker P->>B: PUBLISH (QoS 2, Packet ID 456) Note over P: Store message B-->>P: PUBREC (Packet ID 456) Note over B: Store message P->>B: PUBREL (Packet ID 456) Note over P: Discard message B-->>P: PUBCOMP (Packet ID 456) Note over B: Discard message, deliver to subscribers
  • Guarantee: The message is delivered exactly once. No loss, no duplicates.
  • Use Case: Essential for critical systems where data integrity is paramount, such as in industrial messaging with Sparkplug B or financial transactions.

Choosing the Right QoS Level

QoS LevelGuaranteeDuplicates Possible?OverheadUse Case
0At Most OnceNoLowestNon-critical sensor data, telemetry
1At Least OnceYesMediumCommands, alerts, status updates
2Exactly OnceNoHighestCritical control, financial transactions


Frequently Asked Questions (FAQ)