Pub/Sub Cost Calculator
Price Pub/Sub throughput per TiB including the 1,000-byte minimum message size and per-subscription delivery.
About Pub/Sub Cost Calculator
Pub/Sub prices message throughput by volume, not by message count, but a 1,000-byte minimum per message means a firehose of 100-byte events bills at ten times its real size. Fan-out matters just as much: every subscription attached to a topic re-bills the same bytes on delivery. Teams size Pub/Sub on message counts and are then surprised by the bill, when the two real drivers are the size floor on small events and the number of subscriptions on a busy topic. Confirm the current per-TiB throughput and retention prices in the Google Cloud pricing calculator for your region.
Formula
Pub/Sub Cost
billed bytes = messages × max(payload, 1,000-byte floor) × (1 publish + 1 per subscription); cost = (bytes ÷ 1 TiB − free allotment) × per-TiB price + retained GiB × retention price + egress.
- 1,000-byte floor
- Minimum size Pub/Sub bills per message, regardless of payload
- 1 publish + subscriptions
- Throughput is metered once on publish and once per subscription delivery
- retained GiB
- Unacknowledged backlog and snapshots, billed per GiB-month
Worked example
With the default values below, Pub/Sub Cost Calculator returns Monthly Cost of $1,506.12. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Messages published per monthaccepts 0–10,000,000 millions
- 5,000 millions
- Average message payloadaccepts 0.01–10,240 KB
- 2 KB
- Minimum billed bytes per messageaccepts 0–100,000 bytes
- 1,000 bytes
- Subscriptions per topicaccepts 0–1,000 subscriptions
- 3 subscriptions
- Price per TiB of throughputaccepts 0–1,000 USD/TiB
- 40 USD/TiB
- Free throughput allotmentaccepts 0–100 TiB
- 0.01 TiB
- Message backlog retainedaccepts 0–1,000,000 GiB
- 50 GiB
- Retained storage price per GiBaccepts 0–10 USD/GiB-month
- 0.27 USD/GiB-month
- Snapshot storageaccepts 0–1,000,000 GiB
- 10 GiB
- Cross-region egressaccepts 0–1,000,000 GiB
- 20 GiB
- Egress price per GiBaccepts 0–5 USD/GiB
- 0.01 USD/GiB
Results
- Monthly Cost
- $1,506.12
- Billed Throughput
- 37.243 TiB
- Throughput Charge
- $1,489.72
- Retention Charge
- $16.20
- Egress Charge
- $0.20
- Billed Bytes per Message
- 2,048 bytes
- Extra Paid for the Size Floor
- 0.0%
- Cost per Million Messages
- $0.3012
Step by step
- 1Values used
- 2Pub/Sub Cost
- 3Monthly Cost= 1,506.12
- 4Billed Throughput= 37.243 TiB
- 5Throughput Charge= 1,489.72
- 6Retention Charge= 16.20
- 7Egress Charge= 0.20
- 8Billed Bytes per Message= 2,048 bytes
Assumptions and limits
- The result is derived only from the 11 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax or compounding frequency into account.
- Figures are rounded for display to 4 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
How is Pub/Sub Cost calculated?
billed bytes = messages × max(payload, 1,000-byte floor) × (1 publish + 1 per subscription); cost = (bytes ÷ 1 TiB − free allotment) × per-TiB price + retained GiB × retention price + egress. Pub/Sub prices message throughput by volume, not by message count, but a 1,000-byte minimum per message means a firehose of 100-byte events bills at ten times its real size. Fan-out matters just as much: every subscription attached to a topic re-bills the same bytes on delivery.
Why does Pub/Sub Cost matter?
Teams size Pub/Sub on message counts and are then surprised by the bill, when the two real drivers are the size floor on small events and the number of subscriptions on a busy topic. Confirm the current per-TiB throughput and retention prices in the Google Cloud pricing calculator for your region.
What values do I need to enter?
This calculator takes 11 inputs: Messages published per month, Average message payload, Minimum billed bytes per message, Subscriptions per topic, Price per TiB of throughput, Free throughput allotment, Message backlog retained, Retained storage price per GiB, Snapshot storage, Cross-region egress, Egress price per GiB. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.
Should I batch small messages together?
Usually yes. Because of the 1,000-byte minimum, packing ten 100-byte events into one message cuts billed throughput by roughly 90% — at the cost of coarser retry granularity and higher per-message latency.
