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

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.

Checked 4 Dec 2026·Published 4 Dec 2026·Raw .md
Presets:
Dynamic Worker requests / monthM
Active CPU time per requestms
D1 rows scanned (rows_read) / reqrows
D1 rows written / monthM
D1 SQLite database storageGB
R2 storage volumeGB
R2 Class A writes (PUT/LIST) / moM
Public R2 CDN egress ($0 on R2)GB
Workers Paid bill
$52.75
Includes $5.00 base
Monthly D1 reads
1.40B
25B included on Paid
S3 egress saved
$135.00
@ $0.09/GB AWS S3
Requires Workers Paid ($5/mo base): Daily averages cross Free caps, while monthly D1 reads stay inside the 25B Paid allowance.
Workers base + Request / CPU overage$15.40
D1 SQLite overage (Reads + Writes + Storage)$20.25
R2 Storage + Class A writes ($0 egress)$17.10
Key unit-economics rules
  • 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?

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?

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

Production runbooks for Cloudflare Edge

Common billing questions

If my Worker waits 800 ms for an OpenAI fetch() call, am I billed for 800 CPU milliseconds?

No. Cloudflare Workers only meters active V8 CPU time (parsing JSON, running business logic, encryption), not network I/O wait time while awaiting fetch(), D1, or R2 responses. Most API proxy Workers consume under 2 to 5 CPU ms per request.

Are R2 free tier allowances included on top of the $5 Workers Paid plan?

Yes. Standard R2 storage includes 10 GB-month, 1 million Class A operations, and 10 million Class B operations free each month, with zero egress fees across both Free and Paid plans.

Why did my D1 rows_written double when I added secondary indexes?

Updating or inserting a row into a table with secondary B-tree indexes also writes index entries, which count toward D1 rows_written. Keep only indexes that actively support production WHERE and ORDER BY clauses.

What changed1
  • 2026-12-04: Verified Workers Paid ($5 base, 10M req, 30M CPU ms), D1 (25B rows_read, 50M rows_written), and R2 Class A/B schedules.
Sources checked3

Notice a provider pricing update? Report an outdated rate →