viewof bsDeviceCount = Inputs.range([100, 500000], {
value: 10000,
step: 500,
label: "Number of devices in fleet:"
})
viewof bsMsgsPerHour = Inputs.range([1, 120], {
value: 12,
step: 1,
label: "Messages per device per hour:"
})
viewof bsJsonPayload = Inputs.range([20, 500], {
value: 64,
step: 5,
label: "JSON payload size (bytes):"
})
viewof bsBinaryFormat = Inputs.select(["CBOR (~56% of JSON)", "Protocol Buffers (~30% of JSON)", "MessagePack (~60% of JSON)", "Custom Binary (~20% of JSON)"], {
value: "CBOR (~56% of JSON)",
label: "Target binary format:"
})
viewof bsCostPerGB = Inputs.range([0.01, 1.0], {
value: 0.09,
step: 0.01,
label: "Data transfer cost ($/GB):"
})
bsRatio = bsBinaryFormat === "CBOR (~56% of JSON)" ? 0.56 : bsBinaryFormat === "Protocol Buffers (~30% of JSON)" ? 0.30 : bsBinaryFormat === "MessagePack (~60% of JSON)" ? 0.60 : 0.20
bsBinaryPayload = Math.round(bsJsonPayload * bsRatio)
bsAnnualMessages = bsDeviceCount * bsMsgsPerHour * 24 * 365
bsJsonAnnualGB = (bsAnnualMessages * bsJsonPayload) / 1e9
bsBinaryAnnualGB = (bsAnnualMessages * bsBinaryPayload) / 1e9
bsSavedGB = bsJsonAnnualGB - bsBinaryAnnualGB
bsSavedCost = bsSavedGB * bsCostPerGB
bsReductionPct = ((bsJsonAnnualGB - bsBinaryAnnualGB) / bsJsonAnnualGB * 100)
html`<div style="background: #f8f9fa; border-left: 4px solid #16A085; padding: 15px; margin-top: 15px; font-family: Arial, sans-serif; overflow: hidden;">
<p style="color: #2C3E50; margin-top: 0; font-weight: 700;">Annual Fleet Bandwidth Comparison</p>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 10px;">
<div style="background: white; padding: 12px; border-radius: 4px; border: 1px solid #e0e0e0;">
<div style="color: #7F8C8D; font-size: 11px; text-transform: uppercase; margin-bottom: 4px;">JSON (${bsJsonPayload} B/msg)</div>
<div style="color: #3498DB; font-size: 22px; font-weight: bold;">${bsJsonAnnualGB < 1 ? (bsJsonAnnualGB * 1000).toFixed(0) + ' MB' : bsJsonAnnualGB.toFixed(1) + ' GB'}/yr</div>
<div style="color: #7F8C8D; font-size: 11px;">$${(bsJsonAnnualGB * bsCostPerGB).toFixed(2)}/year</div>
</div>
<div style="background: white; padding: 12px; border-radius: 4px; border: 1px solid #e0e0e0;">
<div style="color: #7F8C8D; font-size: 11px; text-transform: uppercase; margin-bottom: 4px;">Binary (${bsBinaryPayload} B/msg)</div>
<div style="color: #16A085; font-size: 22px; font-weight: bold;">${bsBinaryAnnualGB < 1 ? (bsBinaryAnnualGB * 1000).toFixed(0) + ' MB' : bsBinaryAnnualGB.toFixed(1) + ' GB'}/yr</div>
<div style="color: #16A085; font-size: 11px;">$${(bsBinaryAnnualGB * bsCostPerGB).toFixed(2)}/year</div>
</div>
<div style="background: white; padding: 12px; border-radius: 4px; border: 2px solid #E67E22;">
<div style="color: #7F8C8D; font-size: 11px; text-transform: uppercase; margin-bottom: 4px;">Annual Savings</div>
<div style="color: #E67E22; font-size: 22px; font-weight: bold;">${bsSavedGB < 1 ? (bsSavedGB * 1000).toFixed(0) + ' MB' : bsSavedGB.toFixed(1) + ' GB'}</div>
<div style="color: #E67E22; font-size: 11px;">${bsReductionPct.toFixed(0)}% reduction | $${bsSavedCost.toFixed(2)} saved</div>
</div>
</div>
<div style="margin-top: 12px; padding: 10px; background: #f0f7ff; border-radius: 4px; font-size: 13px; color: #2C3E50;">
<strong>Fleet scale:</strong> ${(bsAnnualMessages / 1e6).toFixed(1)}M messages/year |
<strong>Per-device daily:</strong> JSON ${(bsJsonPayload * bsMsgsPerHour * 24 / 1024).toFixed(1)} KB, Binary ${(bsBinaryPayload * bsMsgsPerHour * 24 / 1024).toFixed(1)} KB
</div>
</div>`Fleet Bandwidth Savings Calculator
Fleet Bandwidth Savings Calculator
animation
rest
protocols
Try Change Target binary format: while keeping the fleet and message inputs fixed. Then press Calculate bandwidth savings.
Observe After pressing Calculate bandwidth savings, watch annual savings change with Target binary format:.
Explain Explain why Number of devices in fleet: changes annual bandwidth and cost savings after you press Calculate bandwidth savings.
Technical boundaries. Binary payload sizes use fixed ratios of JSON payload size and rounding. Annual messages assume the same hourly rate for 24 hours across 365 days.
Interactive: Fleet Bandwidth Savings Calculator
Estimate annual bandwidth and cost savings when migrating from JSON to a binary format across your IoT fleet.