Affiliate Reviews Hosting Reviews

Cloudflare R2 vs Backblaze B2 for Developer Storage: Real Egress Savings Tested

June 21, 2026 9 min read

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

FeatureCloudflare R2Backblaze B2
Storage price$0.015 / GB / month$0.006 / GB / month
Egress to internetFree (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 / month10 GB
Free egress tierUnlimited1 GB / day (β‰ˆ30 GB / month)
S3 compatibilityFull S3 APIS3-compatible API
Global CDN built-inYes (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, there are a few implementation details worth understanding before migrating a production application.

Cloudflare R2 Integration

R2 was intentionally designed to minimize migration friction from Amazon S3.

Most SDKs require only:

  • Endpoint URL change
  • Access key update
  • Secret key update

For example, in Python with Boto3:

import boto3

s3 = boto3.client(
    "s3",
    endpoint_url="https://<account-id>.r2.cloudflarestorage.com",
    aws_access_key_id="YOUR_KEY",
    aws_secret_access_key="YOUR_SECRET"
)

The rest of the upload and download logic typically remains unchanged.

This is one reason many developers move large media workloads to R2 with relatively little engineering effort.

Backblaze B2 Integration

Backblaze originally exposed its own API but now supports an S3-compatible endpoint.

Migration is similarly straightforward:

import boto3

s3 = boto3.client(
    "s3",
    endpoint_url="https://s3.us-west-000.backblazeb2.com",
    aws_access_key_id="YOUR_KEY",
    aws_secret_access_key="YOUR_SECRET"
)

Most modern frameworks:

  • Django
  • Laravel
  • Rails
  • Next.js
  • Spring Boot

already support B2 through existing S3 storage adapters.

From a development perspective, integration effort is nearly identical.

CDN Performance: The Part Pricing Pages Skip

Storage cost is only part of the equation.

Users care about:

  • Download speed
  • Latency
  • Cache hit rates
  • Global availability

This is where architecture matters more than raw storage pricing.

Cloudflare R2

R2 benefits from existing Cloudflare infrastructure.

Objects can be served through:

  • Cloudflare Workers
  • Custom domains
  • Cached edge responses
  • Cloudflare CDN routing

The storage layer and delivery layer live inside the same ecosystem.

That creates several advantages:

  • Simpler configuration
  • Fewer moving parts
  • Consistent caching behavior
  • No bandwidth accounting concerns

For developers already using Cloudflare DNS, setup can take minutes.

Backblaze B2

B2 does not include a built-in global CDN.

You typically pair it with:

  • Cloudflare
  • Fastly
  • Bunny CDN
  • KeyCDN

This isn't necessarily a disadvantage.

In fact, it can provide more flexibility.

The tradeoff is complexity.

You now manage:

Storage Layer
+
CDN Layer

instead of a more integrated experience.

For experienced infrastructure teams this is normal.

For solo developers it adds configuration overhead.

Image Hosting Workload Test

Let's model a realistic SaaS application.

Assets:

50,000 images
Average image size: 400 KB
Total storage: ~20 GB

Monthly traffic:

500,000 image views

Resulting bandwidth:

Approximately 200 GB/month

R2

Storage:

20 GB Γ— $0.015
β‰ˆ $0.30/month

Egress:

$0

Operations:

Negligible.

Total:

~$0.30–$1.00/month

depending on request volume.

B2 Without Cloudflare

Storage:

20 GB Γ— $0.006
β‰ˆ $0.12/month

Egress:

200 GB Γ— $0.01
β‰ˆ $2.00/month

Operations:

Minimal.

Total:

~$2.20/month

B2 With Cloudflare

Storage:

$0.12/month

Egress:

$0

Total:

~$0.12–$0.50/month

Winner:

B2 + Cloudflare

from a pure cost perspective.

Backup and Archive Workloads

Not every storage workload serves files to users.

Many developers use object storage for:

  • Database backups
  • Log archives
  • Media archives
  • Disaster recovery

These workloads behave differently.

Example:

5 TB stored
100 GB downloaded/month

R2

Storage:

5,000 GB Γ— $0.015
β‰ˆ $75/month

Egress:

$0

Total:

~$75/month

B2

Storage:

5,000 GB Γ— $0.006
β‰ˆ $30/month

Egress:

100 GB Γ— $0.01
β‰ˆ $1/month

Total:

~$31/month

This is a completely different outcome.

For archive-heavy workloads, B2 often wins decisively because storage cost dominates bandwidth cost.

Video Hosting Workload Test

Video dramatically changes the economics.

Consider:

2 TB stored
20 TB streamed monthly

R2

Storage:

2,000 GB Γ— $0.015
β‰ˆ $30/month

Egress:

$0

Total:

~$30/month

B2 Without Cloudflare

Storage:

β‰ˆ $12/month

Egress:

20,000 GB Γ— $0.01
β‰ˆ $200/month

Total:

~$212/month

B2 With Cloudflare

Storage:

β‰ˆ $12/month

Egress:

$0

Total:

~$12/month

Again, Cloudflare becomes the deciding factor.

Without Cloudflare, R2 wins easily.

With Cloudflare, B2 becomes significantly cheaper.

Operational Simplicity

One category often ignored in storage comparisons is operational complexity.

R2 Simplicity Score

Typical setup:

Upload
Store
Serve

Everything remains within Cloudflare.

Advantages:

  • Fewer vendors
  • Simpler billing
  • Less configuration
  • Easier troubleshooting

This simplicity has real value.

B2 Simplicity Score

Typical setup:

Upload
Store in B2
Route through Cloudflare
Configure caching
Manage origins

Still straightforward.

But undeniably more moving parts.

Developers comfortable with infrastructure won't care.

Developers who want fewer decisions often will.

Data Durability and Reliability

Both services target enterprise-grade durability.

For practical purposes:

  • Multiple copies
  • High durability guarantees
  • Regional redundancy mechanisms

exist on both platforms.

Most small and medium projects will never notice a meaningful reliability difference.

Provider choice is far more likely to be driven by economics than durability concerns.

Migration From Amazon S3

A common use case is escaping AWS egress fees.

Migration difficulty is relatively low.

Typical process:

Step 1

Create destination bucket.

Step 2

Copy objects using:

rclone
s5cmd
AWS CLI
custom scripts

Step 3

Update application endpoint.

Step 4

Verify uploads and downloads.

Step 5

Switch production traffic.

Because both services support S3-compatible APIs, migration tends to be easier than developers expect.

Which Provider Fits Different Projects?

Personal Website

Winner: B2

Storage costs dominate.

Traffic is usually low.


Photo Hosting Application

Winner: R2

Large amounts of user-facing traffic benefit from free egress.


SaaS With User Uploads

Winner: R2

Predictable bandwidth costs are valuable.


Backup Storage

Winner: B2

Archive workloads rarely download enough data to justify R2's higher storage price.


Video Delivery Platform

Winner: Depends

Without Cloudflare:

R2

With Cloudflare:

B2

Static Asset Hosting

Winner: B2 + Cloudflare

Very difficult to beat economically.

The Biggest Pricing Trap

The largest mistake developers make is comparing storage pricing alone.

They see:

R2: $0.015/GB
B2: $0.006/GB

and conclude:

B2 is cheaper.

Sometimes that's true.

Sometimes it isn't.

A workload storing:

100 GB

and serving:

20 TB/month

behaves completely differently from one storing:

20 TB

and serving:

100 GB/month

Bandwidth often matters more than storage.

Always model both.

My Recommendation

If you're already invested in Cloudflare and don't mind routing traffic through its edge network, Backblaze B2 offers some of the best storage economics available today.

The combination of:

  • Low storage pricing
  • S3 compatibility
  • Cloudflare Bandwidth Alliance

creates exceptional value.

If you want the simplest possible architecture with predictable billing and no bandwidth calculations, Cloudflare R2 is extremely compelling.

The free egress policy removes an entire category of infrastructure anxiety.

Final Verdict

Cloudflare R2 and Backblaze B2 are both excellent alternatives to traditional cloud object storage, but they optimize for different priorities.

R2 is fundamentally an egress-first product. It sacrifices some storage-cost efficiency in exchange for eliminating one of the most painful and unpredictable line items in cloud billing. For applications that serve large amounts of user-facing content, that simplicity can be worth far more than the storage premium.

Backblaze B2 is fundamentally a storage-first product. Its per-gigabyte pricing is among the lowest available, making it exceptionally attractive for backups, archives, and any workload where stored data significantly outweighs downloaded data. When paired with Cloudflare through the Bandwidth Alliance, it also becomes one of the cheapest ways to serve content at scale.

For developers who prioritize simplicity, R2 is usually the safer choice.

For developers willing to add Cloudflare to the stack and optimize for cost, B2 often delivers the lowest total bill.

The real lesson is that storage cost alone rarely determines the winner. Understanding your download patterns, CDN strategy, and traffic growth matters far more than comparing the numbers on the pricing page.

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 save

Comments (0)

No comments yet. Be the first!

Leave a Comment

Sign in to comment with your profile.

πŸ“¬ Weekly Newsletter

Stay ahead of the curve

Get the best programming tutorials, data analytics tips, and tool reviews delivered to your inbox every week.

No spam. Unsubscribe anytime.