Nov 18, 20265 min read

Google Cloud Storage vs Cloudflare R2

How Google Cloud Storage and Cloudflare R2 compare on storage and operation prices, egress, storage classes, APIs, signed URLs and where your backend runs, with a worked bill and the GCS bucket declared in Go.

Illustration for Google Cloud Storage vs Cloudflare R2

Google Cloud Storage and Cloudflare R2 both store objects behind HTTPS, and for a backend the choice mostly comes down to where the bytes go after you store them. GCS sits inside Google Cloud next to Cloud Run and BigQuery, and bills for internet egress. R2 sits on Cloudflare's network and bills nothing for egress.

This comparison covers prices with a worked monthly bill, APIs and auth, and features, and then shows a GCS bucket declared in Go with Encore, which provisions it in your own GCP project. Encore does not provision R2.

GCS vs R2 at a glance

Google Cloud StorageCloudflare R2
Standard storageAbout $0.020 per GiB-month in us-central1$0.015 per GB-month
Write operations$5.00 per million Class A, Standard, single region$4.50 per million Class A
Read operations$0.40 per million Class B, Standard, single region$0.36 per million Class B
Internet egressFrom $0.12 per GiB, worldwide excluding Asia and AustraliaFree
Egress inside Google Cloud, same regionFreeNot applicable
Storage classesStandard, Nearline, Coldline, ArchiveStandard, Infrequent Access
APIGCS JSON and XML APIs, client librariesS3-compatible API, Workers binding
AuthIAM service accounts, signed URLsAPI tokens, presigned URLs
Free tierLimited Always Free usage in some US regions10 GB-month, 1 million Class A, 10 million Class B

GCS prices come from the Cloud Storage pricing page and R2 prices from the R2 pricing page, both checked on November 18, 2026. GCS bills storage per GiB-hour, which works out to roughly $0.020 per GiB-month for Standard in Iowa.

What does a month cost on each?

Take an app that stores 500 GB of user uploads, writes 2 million objects and serves 20 million reads a month. Storage and operations land close together: about $10 for storage plus $10 for writes and $8 for reads on GCS, against about $7.35 for storage plus $4.50 and $3.60 for operations on R2 after its free tier, and the difference comes from egress: if those 20 million reads move 2 TB to browsers, GCS adds roughly $245 at $0.12 per GiB, and R2 adds nothing.

If the same files are read by Cloud Run services or a data pipeline in the same region instead, GCS egress is free and the two bills end up within a few dollars, while R2 adds a second provider, a second set of credentials and an internet round trip to every read from Google Cloud. The bill follows who reads the objects more than how many objects you store.

APIs, auth and features

R2 speaks a large part of the S3 API, so any S3 SDK with a custom endpoint works, and Workers can bind a bucket directly. GCS has its own APIs and client libraries, and services on Cloud Run authenticate with their service account instead of a long-lived token, which keeps keys out of environment variables. Both support signed URLs for direct browser uploads and downloads, object lifecycle rules and event notifications, with GCS sending them to Pub/Sub as described in the GCS event notifications guide.

GCS has colder storage classes, Coldline and Archive, for backups and compliance archives that are rarely read, plus Autoclass to move objects between classes automatically. R2 has Standard and Infrequent Access, and Infrequent Access adds a retrieval fee and a minimum storage duration.

How do you declare a GCS bucket with Encore?

Encore

Encore brings infrastructure from code: a bucket is an objects.NewBucket declaration in the Go service that uses it. encore run gives you a local bucket during development, and a deploy to GCP provisions a Cloud Storage bucket in your project, with access granted to the services that use it based on the operations in the code. The same declaration becomes S3 on AWS. A bucket marked Public: true is configured for public reads with a CDN in front, per the object storage docs.

Application code passes through Encore and infrastructure guardrails to resources provisioned in your own AWS or GCP account.
Get started
brew install encoredev/tap/encore &&
encore app create
Copy

Run in your terminal to get started locally.

// uploads/uploads.go package uploads import ( "context" "time" "encore.dev/beta/errs" "encore.dev/storage/objects" ) var Uploads = objects.NewBucket("user-uploads", objects.BucketConfig{ Versioned: false, }) type UploadURLParams struct { Key string `json:"key"` } type UploadURLResponse struct { URL string `json:"url"` } // UploadURL returns a signed URL the browser can PUT the file to directly. //encore:api auth method=POST path=/uploads/url func UploadURL(ctx context.Context, p *UploadURLParams) (*UploadURLResponse, error) { if p.Key == "" { return nil, &errs.Error{Code: errs.InvalidArgument, Message: "key is required"} } u, err := Uploads.SignedUploadURL(ctx, p.Key, objects.WithTTL(15*time.Minute)) if err != nil { return nil, err } return &UploadURLResponse{URL: u.URL}, nil }

The auth endpoint runs behind your app's auth handler, the file bytes go from the browser straight into the bucket, and only the key passes through the API. A coding agent adding a new kind of upload declares or reuses a bucket in the same change, tests it against the local bucket with encore run, and does not need GCS credentials in the code. Encore provisions an IAM role for the service, or a service account on GCP.

Best fit: Go or TypeScript backends on GCP that want buckets declared in application code, running locally, and provisioned as Cloud Storage in your own project.

How to choose

Pick R2 when most reads are downloads to browsers or clients outside any cloud, such as user-generated media or public assets, since free egress dominates the bill. Pick Cloud Storage when the readers are your own services or pipelines in Google Cloud, when you want service-account auth instead of tokens, or when you need Coldline and Archive. Pick Encore when the bucket belongs to a backend on GCP and you want it declared next to the code that uses it, with a local bucket from encore run.

Frequently asked questions

Is Cloudflare R2 cheaper than Google Cloud Storage?

Yes, for data that is downloaded a lot over the internet, since R2 charges nothing for egress while GCS internet egress starts at $0.12 per GiB, and R2 Standard storage is $0.015 per GB-month against about $0.020 for GCS Standard in us-central1. For data read mostly by services inside Google Cloud in the same region, the egress difference disappears and GCS is often the simpler choice.

Does Cloudflare R2 work with the Google Cloud Storage API?

No. R2 implements a large part of the Amazon S3 API, so you use S3 SDKs with an R2 endpoint. GCS has its own JSON and XML APIs and client libraries, plus an XML API that is interoperable with many S3 tools through HMAC keys.

When should a backend on GCP use Cloud Storage instead of R2?

When the readers are Cloud Run services, GKE pods or BigQuery jobs in the same project, when you want IAM service accounts instead of API tokens, or when you need storage classes like Coldline and Archive and object lifecycle rules tied to your Google Cloud billing.

How do I create a GCS bucket with Encore?

Declare it with objects.NewBucket in Go. encore run gives you a local bucket for development, and deploying to GCP provisions a Cloud Storage bucket in your project with access granted only to the services that use it.

Deploy to your cloud on AWS and Google Cloud
without managing infrastructure

Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.

~/orders — claude
Claude Code
Claude Code v2.1.180Opus 5.5~/orders