Written by Huifer, solo developer and maintainer of TanStack Ship.
I run production apps on Cloudflare Workers, and D1 is the piece I keep getting asked to price correctly. Every time I work through a D1 bill with someone, the same thing happens: they assume reads are the expensive part, and the invoice says otherwise. So I rebuilt the arithmetic from Cloudflare's own pricing page line by line — no estimates dressed up as measurements — and wrote down the break-even points where D1 stops being the cheap answer.
Verified sources: D1 pricing, D1 limits, Workers pricing, D1 best practices, TanStack, web.dev, Cloudflare Developers
Last updated: 2026-11-16
Cloudflare D1 Pricing: What 10M Reads Actually Cost (2026)
Cloudflare D1 pricing at 10 million rows read per month costs $0.00 in D1 usage, because the Workers Paid plan includes the first 25 billion rows read per month. If those reads were billable at the published rate they would cost $0.01. Ten million reads is a rounding error against that allowance — the number that actually moves a D1 invoice is rows written ($1.00 per million), then storage ($0.75 per GB-month above 5 GB), then the Workers envelope around your database ($5/month subscription, $0.30 per million requests past 10M). Updated 2026-11-16: every unit price below still traces to Cloudflare's own pricing and limits pages, cited at the point where each figure is used.
This is a cost-structure breakdown, not a database comparison, written for the buyer who has already put a database on Cloudflare's edge and now needs to know what the meter will do. If the question is still "D1 or Postgres?", the decision page is Cloudflare D1 vs Supabase compared side by side.
TL;DR
- 10M rows read/month: $0.00 D1 usage (25B/month included). At the published $0.001/million rate it would be $0.01 — Measured price, Calculated total.
- 10M rows written/month: $0.00 (50M included). Past 50M, each additional million writes costs $1.00 — writes are 1,000× dearer per row than reads.
- Storage: 5 GB included; above that $0.75/GB-month. 20 GB = $11.25/month — Calculated.
- The floor: Workers Paid has a $5.00/month minimum, plus $0.30 per million requests over 10M/month and $0.02 per million CPU-ms over 30M/month.
- No egress charges.
Cloudflare D1 pricing is metered on three counters — rows read, rows written, and storage — with no egress charge. Reads cost $0.001 per million rows, writes cost $1.00 per million rows, and storage costs $0.75 per GB-month above the 5 GB included.
2026 Update: What Has Changed
This page was first built from Cloudflare's own D1 pricing and D1 limits documentation. This update re-measures nothing — it consolidates the figures that decide an invoice, so the whole model can be checked in one pass. Cloudflare database pricing, here, means three D1 counters plus the Workers envelope wrapped around them.
| Meter | Included on Workers Paid | Rate past the allowance | Effect on a normal SaaS |
|---|---|---|---|
| Rows read | 25 billion / month | $0.001 / million | $0.00 — a full billion rows past the allowance bills at $1.00 |
| Rows written | 50 million / month | $1.00 / million | The first line to move on churn-heavy tables |
| Storage | 5 GB / month | $0.75 / GB-month | 20 GB calculates to $11.25/month |
| Workers requests | 10 million / month | $0.30 / million | On top of the $5.00 subscription minimum |
| Workers CPU | 30 million CPU-ms / month | $0.02 / million | 100M requests at 7 ms averages $41.80/month all-in |
Three rules stay fixed inside this model: there is no egress or data-transfer charge on data read from D1, there is no separate D1 compute line because Worker CPU is billed through Workers pricing, and read replication adds no per-replica charge.
What decides whether you sit in the cheap zone is also unchanged — the shape of the workload, not the unit prices. Ten million reads is 0.04% of the included 25 billion and bills at $0.00, while writes cost 1,000× more per row than reads. The boundaries that force a decision are the daily free-tier caps (5M rows read, 100k rows written, 5 GB total), the hard 10 GB per-database ceiling on Workers Paid, and the single Durable Object behind each database that serialises queries. If your concern is only where the free plan stops, those per-day numbers are broken out in the Cloudflare D1 free tier limits breakdown.
Everything below is the derivation: unit prices first, then the meta-object method for measuring your own rows, then the points where D1 stops being the cheap answer.
The Short Answer: 10 Million Reads Costs $0.00, Not $0.01
Two readings of "10M reads" produce completely different decisions.
Case A — 10 million rows read per month
The Workers Paid plan includes the first 25 billion rows read per month. Ten million rows is 0.04% of that allowance.
Calculation: 10,000,000 rows → 10 million-row units × $0.001 = $0.01 if billed. Because 10M sits inside the included 25B, the billed amount is $0.00. To reach a $1.00 read bill you would have to read one billion rows beyond the included allowance in a month — roughly 33M reads per day.
Case B — 10 million rows read per day
This case changes the plan, not the price. The Workers Free plan allows 5 million rows read per day, resetting at 00:00 UTC. Ten million rows read in a day exceeds that, and per the D1 FAQ, queries start returning errors until you move to Workers Paid — which does not mean paying per read, only the $5.00/month subscription minimum.
The cost table for a 10M-read workload
| Meter | Free plan | Workers Paid (per month) | A 10M-read app, Paid plan |
|---|---|---|---|
| Rows read | 5M / day | 25B included, then $0.001 / million | $0.00 |
| Rows written | 100k / day | 50M included, then $1.00 / million | $0.00 (under 50M writes) |
| Storage | 5 GB total, 500 MB max per database | 5 GB included, then $0.75 / GB-mo | $0.00 (under 5 GB) |
| Egress / transfer | Not charged | Not charged | $0.00 |
| Workers requests | 100k / day | 10M included, then $0.30 / million | Depends on traffic, not reads |
| Subscription | — | $5.00 / month minimum | $5.00 |
Prices are Measured from Cloudflare's pricing and limits pages, captured 2026-10-23; the right-hand column is Calculated from those unit prices.
Cloudflare Database Pricing: The Four Bill Components, Line by Line
Rows read — $0.001 per million
Rows read measure rows scanned, not rows returned. Filtering on an unindexed column may return 10 rows to your Worker while still reading 50,000 rows to find them. Row size does not matter: a 1 KB row and a 100 KB row each count as one. An index costs one extra written row per write but can collapse a 50,000-row scan into a 10-row scan.
Rows written — $1.00 per million (this is the one that bites)
INSERT, UPDATE and DELETE all count. Each additional million rows written past the 50M included allowance costs $1.00 — one thousand times the price of a million reads. Writes are also slower, because they must be durably persisted across several locations. High-churn tables — audit logs, activity feeds, per-request event rows — are where a D1 bill turns from "free" to "noticeable".
Storage — $0.75 per GB-month above 5 GB
Storage is the sum of all databases in the account, and tables and indexes both count — the indexes that save read costs are also occupying storage you pay for.
Calculation: 20 GB stored → (20 − 5) × $0.75 = $11.25/month — over a thousand times the read bill of a 10M-read app. Storage is usually the first D1 line to become material. The hard ceiling: 10 GB maximum per database, which cannot be raised; only the account-level 1 TB limit can be adjusted.
The Workers envelope — subscription, requests, CPU
The database does not run by itself. Workers Paid bills $5.00/month minimum, includes 10 million requests and 30 million CPU-milliseconds, then charges $0.30 per additional million requests and $0.02 per additional million CPU-ms.
Calculation (Cloudflare's own worked example, scaled): 100 million requests/month at 7 ms average CPU → $5.00 subscription + $27.00 requests + $9.80 CPU ≈ $41.80/month, while the D1 line item could still be $0.00. At realistic traffic, the Workers request bill usually dwarfs the D1 bill.
How to Estimate Your Own Bill Instead of Guessing
Read the meta object on every query
Every D1 query returns a meta object with rows_read and rows_written for that statement — the documented way to attribute volume to specific queries. The same counters appear in the dashboard under Metrics → Row Metrics and via the GraphQL Analytics API.
// D1 meta object — rows_read / rows_written per statement
const result = await env.DB.prepare(
"SELECT * FROM users WHERE created_at > ?1",
).bind(cutoff).all();
// result.meta.rows_read → rows scanned by this statement
// result.meta.rows_written → rows written by this statement
// result.meta.duration → reported query duration in seconds
export async function onRequest(context: { env: Env }) {
const { env } = context;
const started = Date.now();
const users = await env.DB
.prepare("SELECT id, email FROM users WHERE created_at > ?1")
.bind(cutoff)
.all<{ id: string; email: string }>();
const scanned = users.meta?.rows_read ?? 0;
// Log the scan cost, not just the result count.
console.log("rows scanned", scanned, "rows returned", users.results.length);
return Response.json({ count: users.results.length, scanned, ms: Date.now() - started });
}
If rows_read is far larger than results.length, you have an unindexed scan — a cost problem and a latency problem at once.
Reproduce the arithmetic with a calculator you can re-run
// Cloudflare D1 + Workers cost model — unit prices as of 2026-10-23
const PRICE = {
workersSubscription: 5.0, // USD / month, Workers Paid minimum
requestsIncluded: 10_000_000, // per month
requestPerMillion: 0.3, // USD per additional million requests
cpuMsIncluded: 30_000_000, // per month
cpuMsPerMillion: 0.02, // USD per additional million CPU-ms
rowsReadIncluded: 25_000_000_000,// per month
rowsReadPerMillion: 0.001, // USD per additional million rows read
rowsWrittenIncluded: 50_000_000, // per month
rowsWrittenPerMillion: 1.0, // USD per additional million rows written
storageIncludedGb: 5, // per month, summed across all databases
storagePerGbMonth: 0.75, // USD
};
export function estimateMonthlyCost(input: {
rowsRead: number;
rowsWritten: number;
storageGb: number;
workerRequests: number;
cpuMs: number;
}) {
const over = (used: number, included: number, perMillion: number) =>
used <= included ? 0 : ((used - included) / 1_000_000) * perMillion;
const reads = over(input.rowsRead, PRICE.rowsReadIncluded, PRICE.rowsReadPerMillion);
const writes = over(input.rowsWritten, PRICE.rowsWrittenIncluded, PRICE.rowsWrittenPerMillion);
const storage = Math.max(0, input.storageGb - PRICE.storageIncludedGb) * PRICE.storagePerGbMonth;
const requests = over(input.workerRequests, PRICE.requestsIncluded, PRICE.requestPerMillion);
const cpu = over(input.cpuMs, PRICE.cpuMsIncluded, PRICE.cpuMsPerMillion);
return {
d1: Number((reads + writes + storage).toFixed(2)),
workers: Number((PRICE.workersSubscription + requests + cpu).toFixed(2)),
total: Number((PRICE.workersSubscription + reads + writes + storage + requests + cpu).toFixed(2)),
};
}
// 10M rows read, 10M written, 2 GB stored, 5M requests, 40M CPU-ms
console.log(estimateMonthlyCost({
rowsRead: 10_000_000,
rowsWritten: 10_000_000,
storageGb: 2,
workerRequests: 5_000_000,
cpuMs: 40_000_000,
}));
// → { d1: 0, workers: 5.2, total: 5.2 }
That last line is the punchline: a 10M-read D1 workload costs $0.00 in D1 usage. The $5.20 is the Workers plan and the CPU overage — the database is not the bill.
A worked scenario, with every assumption labelled
Estimated scenario (not measured): a self-serve SaaS at 200,000 MAU, each user triggering ~60 row reads and 2 row writes per day. That is 360M rows read and 12M rows written per month on 2 GB of storage — all inside the included allowances, so D1 costs $0.00. The Workers side of the same app: 60M requests at 7 ms CPU is $15.00 of requests plus $7.80 of CPU on top of the $5.00 subscription, i.e. about $27.80/month. The same app on managed Postgres plus a managed auth provider plus a Node host typically starts around $45–70/month — but that comparison has different moving parts, so treat it as a pointer, not a conclusion.
When D1 Stops Being the Cheap Answer
The 10 GB per-database ceiling is hard
Each database caps at 10 GB and that limit cannot be raised. The supported growth path is horizontal — many small databases, per tenant or per entity. That is a real architecture, but it means designing for sharding from day one instead of discovering it during an incident.
One Durable Object per Database: Single-Threaded by Design
Each D1 database is backed by a single Durable Object and processes queries one at a time. Cloudflare's guidance: at 1 ms average query duration you get roughly 1,000 queries per second; at 100 ms, roughly 10. Read replication helps only if your reads are geographically separable, and replicas do not change write throughput.
SQLite Underneath: Write-Heavy and Join-Heavy Workloads Are the Wrong Shape
D1 is SQLite underneath, with a single writer. Reporting tools, analytics warehouses and multi-tenant systems with heavy cross-entity joins will fight that constraint instead of using the platform. If that is your product, read the comparison page before optimising a meter that was never the constraint.
Which SaaS Template Should You Actually Pick?
The cost decision only makes sense inside a product decision, because the template you buy determines which meters you pay. The practical question is not "is D1 cheap?" but "does my traffic shape match the data layer this template ships with?" That is exactly the axis I score templates on.
- To see how edge-native templates compare on data layer, runtime and cost at the same traffic level, start with the best SaaS boilerplates of 2026 compared.
- To see what is actually shipped, browse the template catalogue and check each template's data layer against your expected traffic.
- If you just want the number, Cloudflare D1 vs Supabase compared side by side is the decision page for this question, and the architecture trade-offs (not the prices) are in D1 vs Postgres in production: limits, pricing, and when to graduate.
Frequently Asked Questions
How much does 10 million Cloudflare D1 reads cost?
Inside the Workers Paid plan's included 25 billion rows read per month, 10 million reads cost $0.00. At the published $0.001 per million rate they would be billed at $0.01, so reads only become a cost driver past billions of rows. What actually moves the invoice is rows written at $1.00 per million and storage at $0.75 per GB-month above 5 GB.
Do I need the Workers Paid plan to read more than 5 million rows per day?
Yes. The Workers Free plan allows 5 million rows read and 100,000 rows written per day, resetting at 00:00 UTC. Per Cloudflare's D1 FAQ, once you hit the daily limit, queries return errors indicating it was exceeded, and you cannot insert or alter tables until you upgrade — typically within minutes, and never retroactively charged.
Does Cloudflare D1 charge for data transfer or egress?
No. The D1 pricing FAQ states there are no data transfer or egress charges for data accessed from D1, and that read replication does not charge extra for replicas — you pay for rows read and rows written the same way. D1 does not bill compute separately; CPU time your Worker spends serialising results is billed through Workers pricing instead.
Is Cloudflare D1 cheaper than Supabase Postgres?
On database metering alone, yes for most small-to-mid SaaS workloads: D1 includes 25 billion rows read and 50 million rows written per month, so a normal application pays $0.00 for its database and its real invoice is Workers requests. But the products are not interchangeable — D1 has a hard 10 GB per-database ceiling and a single writer; Postgres has neither.
What happens if I exceed the free plan limits on reads and writes?
Queries stop running. The D1 API returns errors indicating the daily limits have been exceeded, and once you reach the included storage limit you must delete unused databases before you can insert data or create tables. On Workers Paid there is no hard stop — you are billed at the published rates.
What does Cloudflare database pricing include beyond rows and storage?
The D1 line item is only rows read, rows written and storage — no data-transfer or egress charge, and no separate D1 compute charge. Everything else on the invoice belongs to Workers: the $5.00/month Paid subscription, $0.30 per million requests past 10M/month, and $0.02 per million CPU-ms past 30M/month. That is how a database bill reads $0.00 while the total reads $41.80.
Is D1 billed per database or per account?
Reads and writes are metered per query, but storage is the sum across every database in the account, and table space plus index space both count. The account-level ceiling is 1 TB and can be adjusted; the per-database ceiling is 10 GB and cannot be raised, so a large dataset is priced as many small databases rather than one big one.
For the full comparison across this topic, the d1 pricing 2026: Free Tier vs Workers Paid Cost Breakdown covers the whole decision in one place, including the trade-offs summarized above.
Conclusion: The Meter You Should Worry About Is Not the One You Expected
Ten million D1 reads cost $0.00 in D1 usage and pull the entire database line item to zero for a normal SaaS; the bill you will actually pay is Workers requests, CPU and storage on top of a $5.00 subscription. The direct next step: open Cloudflare D1 vs Supabase compared side by side and push your own row counts through both cost models.
If you also need the surrounding product, browse the template catalogue to see which templates ship a D1-native data layer and which ship Postgres.
Disclosure: I build and sell TanStack Ship, a template listed in the comparison above. All D1 and Workers prices were read from Cloudflare's own documentation on 2026-10-23 and can change without notice. Limitations: this is a pricing-structure analysis, not a performance comparison; it contains no benchmark data, no customer case studies and no first-party billing export. Scenario numbers are Estimated, unit prices are Measured, everything derived from them is Calculated.