"How much will the MQTT broker cost?" sounds like a pricing-page question. It is actually a modelling question, because the answer depends less on the vendor and more on how your devices connect: always on or wake-and-send, every second or every 15 minutes, one subscriber or five.

This post walks through the variables that drive MQTT cost, the three pricing models you will meet in 2027, and three concrete fleet sizes (20, 200 and 1,000 devices) worked out step by step. There is a small JavaScript calculator at the end you can paste into your browser console.

The four numbers that decide your bill

Every broker, managed or self-hosted, is ultimately sized on these:

Variable What it is Typical range
Concurrent connections Clients connected at the same moment (devices, gateways, back ends, dashboards) 5 to 100,000+
Connected time How long each client stays connected; often billed as connection minutes or session minutes 1 min/day to 24 h/day
Message rate and size Messages per second per client, bytes per message 0.001 to 100 msg/s, 50 B to 10 KB
Fan-out How many subscribers receive each message 1 to dozens

The trap most teams fall into: they size on devices and forget connected time and fan-out. A device that stays connected all month uses 43,200 minutes (60 × 24 × 30). A message delivered to three subscribers is three outbound messages.

The three pricing models in 2027

MQTT broker comparison 2027: ConnectMQ, HiveMQ, EMQX, Mosquitto, AWS IoT Core, Azure IoT Hub

1. Pay per message / per minute (hyperscaler IoT services)

AWS IoT Core and similar services bill each dimension separately: connectivity minutes, messages (metered in size increments), and often a separate charge for the rules or routing that move data onward. It scales to zero and to millions, but the bill is a function of four or five meters you have to forecast. A firmware bug that publishes in a tight loop becomes a line item.

Good for: very spiky fleets, teams already deep in one cloud.
Watch for: message size increments, rule-engine charges, egress, and that QoS 2 and some MQTT 5 features are not supported on every hyperscaler service.

2. Tiered or usage-based managed brokers

HiveMQ Cloud, EMQX Cloud and others offer a free or serverless tier and then dedicated or usage-based tiers. Pricing varies a lot between tiers, so read where the jumps are: the step from "serverless" to "dedicated" is often the biggest one.

3. Fixed monthly plans with hard limits

The plan includes an allowance of connections, connected minutes and traffic for a flat price. When you hit a limit, the broker refuses the extra work instead of billing you for it. ConnectMQ works this way:

Free Basic Scale
Price $0, one-time, no card $39 / month $199 / month
Concurrent connections 5 100 1,000
Session minutes 10,000 one-time 1,000,000 / month 10,000,000 / month
Traffic (in / out) 100 MB one-time 5 GB / 15 GB 25 GB / 50 GB
Per-topic ACL, shared subscriptions – ✓ ✓

Current numbers are always on the ConnectMQ pricing page; the per-client limits (messages per second, retained messages, message size) are in the plans and broker limits reference.

The trade-off is real: "no overage" means no surprise bill, but it also means a device can be refused when the allowance runs out. You want alerts before that (ConnectMQ warns at 10% remaining) and some headroom in your sizing.

And self-hosting?

Mosquitto, EMQX open source or HiveMQ CE cost "nothing" in licences. The real cost is a VM or two, a TCP load balancer, public IPs and egress, plus the hours your team spends on TLS certificates, auth and ACL files, upgrades, monitoring and the occasional 3 a.m. page. If one engineer spends four hours a month on the broker, that time alone usually costs more than a small managed plan. Self-hosting wins when you already run this kind of infrastructure, or when you need features no managed service offers.

Where should your MQTT broker run in 2027: self-hosted, managed or BYOC

Worked example 1: 20 always-on devices

A small machine-monitoring project: 20 devices on Wi-Fi, each publishing a 300-byte JSON message every 10 seconds, one back-end service and one dashboard subscribing.

  • Connections: 20 devices + 1 back end + 1–3 dashboard tabs ≈ 24 concurrent.
  • Session minutes: 20 × 43,200 = 864,000 per month (the back end adds another 43,200; dashboards only while open).
  • Messages in: 20 × 6/min × 43,200 min ≈ 5.2 million per month.
  • Traffic in: 5.2 M × 300 B ≈ 1.6 GB.
  • Traffic out: two subscribers → ≈ 3.1 GB.

Verdict on ConnectMQ: everything fits in Basic at $39/month (100 connections, 1 M minutes, 5 GB in / 15 GB out), with the minutes at about 90% used. If the fleet will grow, either plan for Scale or make some devices connect only when they have something to say.

Worked example 2: 200 always-on devices

A building-energy rollout: 200 meters publishing 300 bytes every 30 seconds, two back-end consumers.

  • Connections: ≈ 205 concurrent.
  • Session minutes: 200 × 43,200 = 8.64 million.
  • Messages in: 200 × 2/min × 43,200 ≈ 17.3 million.
  • Traffic in: ≈ 5.2 GB. Out (two subscribers): ≈ 10.4 GB.

Verdict: Scale at $199/month (1,000 connections, 10 M minutes, 25 / 50 GB). Basic would fail on both connections and minutes.

Worked example 3: 1,000 devices — it depends on the pattern

3a. Battery sensors that wake every 15 minutes

Each device wakes, connects, publishes one reading and disconnects. Assume each session costs about one minute.

  • Sessions: 1,000 × 96/day × 30 = 2.88 million → ≈ 2.9 million session minutes.
  • Concurrent connections: with random jitter on the wake-up, a few dozen at any moment.
  • Traffic: 2.88 M × 300 B ≈ 0.9 GB in.

Verdict: Scale, with lots of headroom. The same 1,000 devices cost far less than if they stayed connected.

3b. 1,000 devices connected 24/7

  • Session minutes: 1,000 × 43,200 = 43.2 million.

Verdict: this is beyond the Scale allowance. Options: talk to sales about a larger plan, run the broker in your own cloud (BYOC), or put a gateway in front of groups of devices so 1,000 sensors become 20 MQTT connections.

That last point is the biggest lever in MQTT cost modelling: connection pattern matters more than device count. A gateway such as ConnectMQ Edge reading 300 PLC tags is one connection.

A tiny calculator

Paste this into your browser console and change the inputs:

function mqttEstimate({ devices, alwaysOn = true, wakeupsPerDay = 96, minutesPerSession = 1, msgPerMinute = 6, bytesPerMsg = 300, subscribers = 1 }) { const minutes = alwaysOn ? devices * 43_200 : devices * wakeupsPerDay * 30 * minutesPerSession const msgsIn = alwaysOn ? devices * msgPerMinute * 43_200 : devices * wakeupsPerDay * 30 const gbIn = (msgsIn * bytesPerMsg) / 1e9 return { sessionMinutes: minutes.toLocaleString(), messagesIn: msgsIn.toLocaleString(), trafficInGB: gbIn.toFixed(2), trafficOutGB: (gbIn * subscribers).toFixed(2), } } mqttEstimate({ devices: 20, msgPerMinute: 6, subscribers: 2 }) // { sessionMinutes: '864,000', messagesIn: '5,184,000', trafficInGB: '1.56', trafficOutGB: '3.11' } mqttEstimate({ devices: 1000, alwaysOn: false }) // { sessionMinutes: '2,880,000', messagesIn: '2,880,000', trafficInGB: '0.86', trafficOutGB: '0.86' } 

Compare the result with the allowance of any fixed plan, or multiply it by the per-unit rates of a usage-based service.

Five ways to cut MQTT cost, whatever the vendor

  1. Publish on change, not on a timer. Use deadbands: a temperature that moved 0.01 °C is not news.
  2. Batch values into one JSON message instead of one topic per value. Fewer messages, smaller topic overhead.
  3. Connect, publish, disconnect for devices that report rarely. Keep-alive pings on an idle connection still cost connected minutes.
  4. Use retained messages for state so new subscribers do not need a "send me everything" request.
  5. Count every subscriber. Dashboards, loggers and debugging mosquitto_sub -t '#' sessions all multiply outbound traffic.

The usage view you want

Whatever you pick, make sure you can see usage before the invoice or the limit. In ConnectMQ the session minutes, traffic and limits sit in one panel:

ConnectMQ usage meters: session minutes, traffic and plan limits

FAQ

What is the cheapest MQTT broker for a small IoT project?
For a handful of devices, a free tier is enough: ConnectMQ's Free plan (5 connections, 10,000 session minutes, no card) or another vendor's free tier. Beyond that, a fixed plan is usually cheaper than self-hosting once you count your own time.

How many session minutes does one device use per month?
About 43,200 if it stays connected all month. A device that connects for one minute every 15 minutes uses about 2,880.

What happens when I exceed my MQTT plan?
It depends on the model. Usage-based services bill the extra. ConnectMQ never charges overage; it refuses new connections or messages (MQTT 5 reason code 0x97 Quota exceeded) and warns you before that happens.

Is self-hosting Mosquitto really free?
The software is. The VM, load balancer, egress, certificates, monitoring and engineering time are not.

Want to check your own numbers? Start on the free plan, connect a few real devices, and watch the meters for a week. That beats any spreadsheet.