Cloudflare R2 vs Backblaze B2 for Developer Storage: Real Egress Savings Tested
You pick an object storage provider, build your upload pipeline, ship to production β then the first bill arrives and you realize egress fees have doubled your infrastructure costs. It happens constantly, and most pricing pages bury the details deep in footnotes.
Cloudflare R2 and Backblaze B2 are the two most developer-friendly answers to the egress problem. But they solve it differently, and the wrong choice for your architecture can still leave you with a surprising bill.
What You'll Learn
- How R2 and B2 actually price storage, operations, and egress
- Real download costs from a 500 MB asset library under different traffic patterns
- How S3-compatible SDKs work with each provider
- Where each service's CDN story breaks down
- Which provider fits which type of project
The Egress Problem No One Warns You About
Standard S3 egress in AWS costs around $0.09 per GB out to the internet. That sounds manageable until you're serving user-uploaded images, video, or software builds at any real scale. A modest SaaS product pushing 5 TB a month out of S3 can easily spend more on egress than on compute.
Both R2 and B2 were built with this in mind. R2 charges zero egress fees on all outbound traffic. B2 charges for egress but eliminates the fee entirely when traffic exits through Cloudflare's network β a partnership called the Bandwidth Alliance. The nuance matters enormously depending on how you serve your files.
Quick Specs: R2 vs B2 at a Glance
| Feature | Cloudflare R2 | Backblaze B2 |
|---|---|---|
| Storage price | $0.015 / GB / month | $0.006 / GB / month |
| Egress to internet | Free (always) | $0.01 / GB (free via Cloudflare CDN) |
| Class A operations (writes) | $4.50 / million | $0.004 / 1,000 uploads |
| Class B operations (reads) | $0.36 / million | $0.004 / 10,000 downloads |
| Free tier (storage) | 10 GB / month | 10 GB |
| Free egress tier | Unlimited | 1 GB / day (β30 GB / month) |
| S3 compatibility | Full S3 API | S3-compatible API |
| Global CDN built-in | Yes (via Workers / custom domain) | No (requires Cloudflare or Fastly) |
B2's storage price is more than 2x cheaper per GB stored. R2's free egress is the bigger story once you're actually serving files. The crossover point depends heavily on your read-to-write ratio and whether you already use Cloudflare for DNS or CDN.
Pricing Breakdown: Storage, Operations, and Egress
The sticker price on storage is straightforward: R2 at $0.015/GB and B2 at $0.006/GB. If you're archiving 10 TB of backups that almost never get downloaded, B2 wins on raw storage cost by a significant margin.
Operations pricing
Operations are where things get more granular. R2 uses the familiar AWS Class A / Class B model. Writes (PutObject, CopyObject) are Class A at $4.50 per million requests. Reads (GetObject, ListBuckets) are Class B at $0.36 per million. For most apps these costs are small, but high-frequency thumbnail generation or presigned URL workflows can push Class A operations up fast.
B2 charges $0.004 per 1,000 upload calls and $0.004 per 10,000 download calls. That's effectively $4 per million uploads and $0.40 per million downloads β nearly identical to R2. Neither provider is meaningfully cheaper on operations for typical use cases.
Egress: where the real difference lives
R2 has no egress fee. Period. You can serve terabytes to end users directly from an R2 public bucket or through a Worker, and the egress line on your bill stays at zero. This is Cloudflare's core competitive move β they already own the network, so egress is a sunk cost for them.
B2 charges $0.01 per GB to the general internet. However, if your traffic goes through Cloudflare's CDN (either Cloudflare Pages, Workers, or a proxied DNS record pointing to a Cloudflare-fronted origin), that egress cost drops to zero under the Bandwidth Alliance. If you're not using Cloudflare's edge, you pay the $0.01/GB rate.
Egress Test: Serving a 500 MB Asset Library
To make the cost difference concrete, consider a product that stores 500 MB of user-facing assets β images, PDFs, and small video clips β and serves them at different monthly traffic volumes. Here's what the bills look like at three scale points.
# Scenario: 500 MB stored, traffic varies
# Storage cost comparison (monthly)
R2: 0.5 GB Γ $0.015 = $0.0075
B2: 0.5 GB Γ $0.006 = $0.003
# Egress at 100 GB/month (no CDN)
R2: 100 GB Γ $0.00 = $0.00
B2: 100 GB Γ $0.01 = $1.00
# Egress at 1 TB/month (no CDN)
R2: 1,000 GB Γ $0.00 = $0.00
B2: 1,000 GB Γ $0.01 = $10.00
# Egress at 1 TB/month (B2 via Cloudflare CDN)
R2: 1,000 GB Γ $0.00 = $0.00
B2: 1,000 GB Γ $0.00 = $0.00
The takeaway: if you front B2 with Cloudflare, egress goes to zero and B2 is cheaper on storage. If you're not routing through Cloudflare, R2 wins on every bandwidth-heavy workload. At 1 TB egress per month without CDN, B2 costs $10 more β not catastrophic, but it scales linearly. At 50 TB the gap is $500/month.
This is the same dynamic you'll see compared to traditional providers. If you've looked at the true cost of Hetzner vs DigitalOcean for side projects, you'll recognize the pattern: the headline price rarely tells the whole story once traffic enters the picture.
S3 Compatibility and SDK Integration
Both providers expose an S3-compatible API, which means you can swap out your endpoint URL and credentials and keep your existing code largely untouched. That said,
Frequently Asked Questions
Does Cloudflare R2 really have zero egress fees for all traffic?
Yes, Cloudflare R2 charges no egress fees regardless of how much data you serve to end users. This applies whether you use a public R2 bucket, a custom domain, or a Cloudflare Worker in front of the bucket.
Can I use Backblaze B2 without Cloudflare and still avoid egress fees?
No. B2 only waives egress fees when traffic flows through Cloudflare's network via the Bandwidth Alliance. If you serve files directly from B2 or through a different CDN, you pay the standard $0.01 per GB egress rate.
Is Backblaze B2 fully compatible with the AWS S3 SDK?
B2 exposes an S3-compatible API that covers the most common operations, but it is not 100% identical to AWS S3. Features like Object Lock, Replication, and some ACL behaviors differ, so check the B2 S3 compatibility docs before migrating a complex S3 workflow.
Which is better for storing large video files, R2 or B2?
For large video files that are served frequently to end users, R2 is better because zero egress means your bandwidth cost stays flat no matter how many views you get. B2 is a better fit if you use Cloudflare's CDN already or if the files are rarely downloaded.
Can I use multipart uploads with both R2 and B2?
Yes, both R2 and B2 support multipart uploads through their S3-compatible APIs. This is essential for reliably uploading files larger than a few hundred megabytes and works with standard AWS SDK multipart helpers.
π€ Share this article
Sign in to saveRelated Articles
Comments (0)
No comments yet. Be the first!