# Cloudflare Workers, D1 & R2 Monthly Cost & Free-Tier Cliff Simulator

> Canonical URL: https://stackquota.com/calculators/cloudflare-workers-d1-r2-cost/
> Checked: 2026-12-04 · Published: 2026-12-04

Calculate exact Cloudflare Workers Paid ($5/mo) vs Free limits across request volume, CPU milliseconds, D1 SQLite rows_read / rows_written, R2 Class A/B ops, and AWS S3 egress savings.

## Key Takeaways
- Static assets served via Cloudflare Workers Static Assets incur $0 bandwidth and $0 Worker request charges unless run_worker_first routes every asset through JS.
- On D1, the #1 unexpected bill driver is unindexed SQLite full-table scans: 1,000 rows scanned per request across 10M requests equals 10 billion rows_read.
- R2 eliminates AWS S3 $0.09/GB egress fees completely, making Class A write operations ($4.50/M past 1M free) the main metric to batch.

## Where are the real billing cliffs on Cloudflare Workers, D1, and R2?

**Quick answer:** Cloudflare's $5/month Workers Paid plan absorbs 10M dynamic requests, 30M CPU milliseconds, and 25B D1 rows read, meaning surprise bills almost always stem from unindexed D1 table scans, chatty per-item R2 Class A writes, or invoking Worker JS in front of static assets.

Cloudflare's serverless stack is famously inexpensive compared with traditional cloud providers, largely because **Workers bills only active CPU execution time (not I/O wait time)** and **R2 charges $0.00 for egress bandwidth**. However, moving from the Free plan (capped daily at 100,000 Worker requests and 5 million D1 `rows_read` per day) to production traffic exposes three distinct unit-economic cliffs:

1. **Daily Free Caps vs. Monthly Paid Allowances:** On the Free tier, quotas reset every 24 hours UTC, a single Hacker News spike or unindexed SQL query hitting 5.1 million `rows_read` will return hard errors until midnight UTC even if your monthly average is tiny. Upgrading to the **$5/month Workers Paid** base unlocks monthly pooled allowances (10M Worker requests, 30M CPU ms, 25B D1 rows read, 50M D1 rows written) before overage metering begins.
2. **D1 `rows_read` Amplification:** D1 meters every row inspected by SQLite's query engine, not the number of rows returned to your client. Executing `SELECT * FROM events WHERE slug = ? ORDER BY created_at DESC LIMIT 20` without a composite index `(slug, created_at DESC)` forces SQLite to scan every row in `events`. On a 50,000-row table, just 100 requests scan **5,000,000 rows**: exhausting the entire daily Free tier in seconds, or burning 50 billion `rows_read` ($25 overage) at 1M monthly requests.
3. **R2 Class A Mutation Storms:** While 100 TB of R2 public CDN egress costs $0 (saving ~$9,000/month vs uncached AWS S3 egress at $0.09/GB), R2 bills **Class A operations** (`PUT`, `POST`, `COPY`, `LIST`) at **$4.50 per million** beyond the 1M monthly free tier. Writing tiny analytics JSON blobs or per-chunk logs directly to R2 without batching can cost 10x more in Class A ops than the underlying GB-month storage itself.

## Does serving Next.js static exports on Workers cost request fees?

**Quick answer:** No, requests matched directly by Cloudflare Workers Static Assets (`assets.directory`) are served free without consuming Worker request or CPU quotas, provided you do not force `run_worker_first: true` across static paths.

When you deploy a Next.js `output: 'export'` site with `wrangler.jsonc` `assets`, Cloudflare's edge serves HTML, CSS, JS bundles, and WebP images straight from the static asset layer at zero per-request charge. Your Worker entrypoint (`main: "worker/index.js"`) only executes (and only increments billable Worker requests) when a route misses static files (such as `POST /api/feedback` or dynamic redirects) or if you explicitly intercept static routes.

| Resource | Free Tier Cap | Workers Paid ($5/mo) Included | Paid Overage Rate | Primary Optimization Lever |
| :--- | :--- | :--- | :--- | :--- |
| **Worker Requests** | 100K / day | 10M / month | $0.30 / 1M requests | Keep HTML/assets in Static Assets; cache GET APIs |
| **Worker CPU Time** | 10 ms / request | 30M CPU ms / month | $0.02 / 1M CPU ms | Stream JSON/HTML (`TransformStream`); avoid sync crypto |
| **D1 Rows Read** | 5M / day | 25B / month | $0.001 / 1M rows | Verify `SEARCH ... USING COVERING INDEX` via `EXPLAIN` |
| **D1 Rows Written** | 100K / day | 50M / month | $1.00 / 1M rows | Batch high-frequency counters in memory or Queues |
| **R2 Storage & Ops** | 10 GB, 1M A / 10M B | 10 GB, 1M A / 10M B | $0.015/GB, $4.50/M A, $0.36/M B | Bundle small writes; cache Class B reads on CDN |

## Sources Checked
- [Cloudflare Workers Platform Pricing](https://developers.cloudflare.com/workers/platform/pricing/) (checked 2026-12-04)
- [Cloudflare D1 Pricing](https://developers.cloudflare.com/d1/platform/pricing/) (checked 2026-12-04)
- [Cloudflare R2 Pricing](https://developers.cloudflare.com/r2/pricing/) (checked 2026-12-04)
