AWS Lambda Cost Calculator 2026: Serverless Pricing Compared
Serverless billing is notoriously hard to predict. This guide breaks down AWS Lambda, Vercel Functions, Cloudflare Workers and GCP Cloud Functions pricing with real cost tables so you can budget before you deploy.
How Serverless Pricing Works
Every serverless platform charges on two dimensions: invocations (how many times your function runs) and compute (GB-seconds = memory × duration). AWS Lambda gives 1M free invocations + 400K GB-sec free per month. Cloudflare Workers charges $0.50/M requests with no GB-sec fee.
2026 Serverless Cost Table
| Platform | Per invocation | Per GB-sec | Free tier |
|---|---|---|---|
| Cloudflare Workers | $0.50/M | $0.000012 | 100K req/day |
| AWS Lambda | $0.20/M | $0.0000166 | 1M req + 400K GB-sec |
| GCP Cloud Functions | $0.40/M | $0.000025 | 2M req + 400K GB-sec |
| Vercel Functions | $0.40/M | $0.000018 | 100GB-hr/month |
AWS Lambda: Best for AWS Ecosystem
Lambda integrates natively with API Gateway, S3, DynamoDB and EventBridge. At 10M invocations × 150ms × 256MB: approximately $1.67 compute + $1.80 invocation = $3.47/mo after free tier. Perfect for event-driven architectures.
Cloudflare Workers: Cheapest for High-Frequency APIs
Workers runs at the edge (200+ PoPs globally), starts at $5/mo for 10M requests, with no cold starts and sub-millisecond execution. For APIs under 50ms duration, Workers is often 10× cheaper than Lambda.
Real Cost: 10M Requests Per Month
| Platform | 1M req | 10M req | 100M req |
|---|---|---|---|
| Cloudflare Workers | $0 | $5 | $50 |
| AWS Lambda (256MB/150ms) | $0 | $3.47 | $34.70 |
| GCP Cloud Functions | $0 | $4.10 | $41 |
| Vercel Functions | $0.40 | $4.00 | $40 |
Real-World Cost Examples
Abstract pricing tables only go so far. Here are three realistic workloads with exact numbers.
Example 1: REST API — 10M requests/month, 256 MB, 200 ms avg
| Cost component | Calculation | Monthly cost |
|---|---|---|
| Invocations (after 1M free) | 9M × $0.20/M | $1.80 |
| Compute GB-sec (after 400K free) | 10M × 0.2s × 0.25 GB × $0.0000166 | $0.83 |
| Lambda total | $2.63 | |
| Cloudflare Workers (Paid) | $5 flat covers 10M req | $5.00 |
Winner: Lambda — REST APIs at this scale land well under $5/mo thanks to the free tier.
Example 2: Image Processing — 1M requests/month, 1024 MB, 2000 ms avg
| Cost component | Calculation | Monthly cost |
|---|---|---|
| Invocations (within free tier) | 1M — 1M free = 0 | $0.00 |
| Compute GB-sec | 1M × 2s × 1 GB × $0.0000166 | $33.20 |
| Lambda total | $33.20 | |
| Cloudflare Workers | Not suitable — 50 ms CPU cap on free, 30 s on paid but no GPU | |
Winner: Lambda — the only sensible choice for compute-heavy workloads. Workers' CPU wall clock limit disqualifies it here.
Example 3: High-Frequency Edge API — 100M requests/month, 30 ms avg
| Platform | Cost breakdown | Monthly total |
|---|---|---|
| Lambda + API Gateway | $18 Lambda + $35 API GW | $53.00 |
| Cloudflare Workers | $5 base + 90M × $0.50/M | $50.00 |
| Vercel Functions | $40 + egress | ~$45–60 |
Winner: Cloudflare Workers — at 100M short requests the Workers flat pricing wins, especially once you factor in API Gateway costs Lambda accrues.
Hidden Costs Most Tutorials Skip
The Lambda pricing page shows two numbers: invocations and GB-seconds. Your actual invoice will include several more line items that tutorials rarely mention.
- API Gateway: $3.50 per million requests — if your Lambda is HTTP-facing, API Gateway typically doubles the bill. At 10M req/mo that's an extra $35 you won't see coming until the invoice arrives.
- CloudWatch Logs: $0.50 per GB ingested — a verbose logger writing 5 KB per invocation at 10M calls generates 50 GB of logs = $25/mo. Set log retention to 7 days and log only errors in production.
- NAT Gateway: $0.045 per GB of data processed — Lambda inside a VPC (required for RDS access) must route outbound traffic through NAT Gateway. At 100 GB/mo that's $4.50 in NAT alone, plus $0.045/GB of data. Heavy S3 or DynamoDB access amplifies this fast.
- Cold start duration charges — cold starts themselves aren't billed separately, but the added 50–500 ms initialization time is billed as GB-seconds. A 512 MB function with 300 ms cold starts at 1% cold-start rate across 10M invocations adds ~$1.27/mo in invisible compute.
- Provisioned Concurrency: $0.0000097222 per GB-second — keeping functions warm costs ~$14/mo per always-warm 512 MB instance. Often worth it for latency-sensitive endpoints but plan for it.
Rule of thumb: multiply your raw Lambda estimate by 1.5–2× to account for API Gateway and logging before presenting it to stakeholders.
When to Choose Lambda vs Alternative
No single serverless platform wins every workload. Use this decision table to match your use case to the right tool.
| Use case | Best pick | Why | Monthly cost (10M req) |
|---|---|---|---|
| Short API (<50 ms) | Cloudflare Workers | No cold starts, edge PoPs, flat pricing | $5 |
| AWS-integrated backend | Lambda | Native S3/DDB/SQS triggers, IAM | $3–6 |
| Next.js / React SSR | Vercel Functions | Zero-config deploy, built-in CDN | $20+ (Pro) |
| Image / video processing | Lambda (1–10 GB) | High memory, long timeout (15 min) | $30–150 |
| Global low-latency API | Workers or GCP | 200+ PoPs, sub-ms routing | $5–15 |
| Scheduled jobs / cron | Lambda + EventBridge | Native cron, pay-per-execution | <$1 |
| ML inference (>3 GB) | VPS or Lambda SnapStart | Lambda max 10 GB RAM; VPS cheaper at scale | $10–80 |
If your function duration consistently exceeds 500 ms and you run more than 5M invocations per month, a $6 VPS may undercut Lambda on total cost once you factor in API Gateway.
FAQ
How much does AWS Lambda cost per million requests?
AWS Lambda costs $0.20 per million invocations after the free tier (1M/month). Compute costs add $0.0000166725 per GB-second. A 256MB function running 150ms costs ~$0.000000634 per invocation.
Is Cloudflare Workers cheaper than Lambda?
For short-duration, high-frequency functions: yes. Workers at $0.50/M requests with no GB-sec charge beats Lambda for APIs under 30ms. For longer compute (>500ms), Lambda may be cheaper.
What is serverless cold start cost?
Cold starts themselves are free — you only pay for execution time. But cold starts increase duration (50–500ms extra), which increases your GB-sec cost. Cloudflare Workers has no cold starts.
APICalculators Team · Free developer cost tools. Prices from official documentation, reviewed monthly.