Compare Lambda, Cloudflare Workers, Vercel, and GCP Functions pricing. Enter invocations, duration, memory → see exact monthly bills. Free, no signup.
Select provider · Enter invocations and duration · Results update live
Monthly cost for 10M invocations · 256MB · 200ms avg duration.
| Provider | Free tier | Invocation price | Compute price | 10M inv / 200ms / 256MB |
|---|---|---|---|---|
| AWS LambdaMOST POPULAR | 1M inv/mo + 400K GB-s | $0.20/M | $0.0000166725/GB-s | $3.47 |
| Cloudflare Workers | 1M req/day (free plan) | $0.30/M (paid) | $0.012/M GB-s | $2.70 |
| Vercel Functions | 100K GB-s/mo | $0.40/M | $0.018/GB-s | $4.00 |
| GCP Cloud Functions | 2M inv/mo + 400K GB-s | $0.40/M | $0.0000250/GB-s | $3.20 |
AWS API Gateway adds $3.50/M requests — often doubling your Lambda bill. CloudWatch Logs add $0.50/GB. NAT Gateway in VPC adds $0.045/GB. Factor these in for real-world costs.
| Use case | Best choice | Reason |
|---|---|---|
| REST API · under 30ms | Cloudflare Workers | Edge execution, no cold start |
| REST API · 100ms–500ms | AWS Lambda | Free tier, mature ecosystem |
| Heavy compute · 1–5s | AWS Lambda | Up to 10GB memory, 15min timeout |
| Next.js / React SSR | Vercel Functions | Zero-config deployment |
| Event-driven batch | AWS Lambda | Native integration with SQS, SNS, S3 |
Estimate your serverless compute cost across AWS Lambda, Cloudflare Workers, and Vercel.
An API backend handling 50M requests/month (575 req/s) with average 150ms duration and 256MB memory: AWS Lambda compute = 50M × 0.15s × 0.256GB × $0.0000166725/GB-s = $32/month. Plus invocations = 50M × $0.20/M = $10/month. Plus AWS API Gateway = 50M × $3.50/M = $175/month. Total: ~$217/month — a reminder to include API Gateway costs which often exceed Lambda itself.
How we calculate serverless costs.
Sources: AWS Lambda pricing from AWS Lambda pricing page. Cloudflare Workers pricing from Cloudflare Workers pricing page. Vercel Functions pricing from Vercel pricing page. GCP Cloud Functions pricing from Google Cloud pricing page. All are pay-as-you-go, on-demand rates.
Compute cost formula: Serverless compute is billed in GB-seconds: (memory GB) × (duration seconds) × (rate per GB-s). Example: 256MB function running 200ms = 0.256 × 0.2 = 0.0512 GB-s per invocation. The calculator applies this formula automatically with the selected provider's rate.
Free tier handling: AWS Lambda's free tier (1M invocations + 400K GB-s/month) applies permanently (not time-limited). The calculator deducts the free tier automatically. GCP Cloud Functions includes 2M invocations and 400K GB-s free. Cloudflare Workers free plan includes 100K requests/day (3M/month) but requires upgrading to the paid plan for consistent high-volume workloads. Vercel's free tier is per-project and limited.
What is excluded: API Gateway costs (AWS: $3.50/M REST requests, $1/M HTTP API), CloudWatch Logs ($0.50/GB ingested), NAT Gateway for VPC ($0.045/GB processed), Lambda@Edge (different pricing), and Provisioned Concurrency ($0.0000041271/GB-s). Add these based on your architecture — API Gateway alone often equals or exceeds the Lambda compute cost for high-traffic APIs.
For short-duration, high-frequency workloads (under 30ms execution), Cloudflare Workers at $0.30/M invocations plus $0.012/M GB-s can be cheaper than Lambda. The key advantage is no cold starts and edge execution. For longer compute (500ms+) or when you need AWS integrations (S3, DynamoDB, SQS), Lambda's mature ecosystem and generous free tier make it the better choice. Most teams start with Lambda and add Workers for latency-critical edge use cases.
AWS Lambda's free tier includes 1 million invocations and 400,000 GB-seconds of compute per month, permanently (not a 12-month trial). At 256MB/200ms per invocation, 400K GB-s covers approximately 7.8 million invocations of compute — well above the invocation limit. The practical limit is the 1M invocation cap, not the compute cap, for typical workloads.
Yes, Lambda cold starts add 100–500ms latency for the first invocation after a function is idle. Python and Node.js cold starts average 100–300ms. Java and .NET cold starts average 500ms–2s due to JVM/CLR initialization. Mitigation options: Provisioned Concurrency (eliminates cold starts, billed continuously), scheduled keep-warm pings (reduces frequency, doesn't eliminate), or Cloudflare Workers/Fastly (no cold starts by architecture). For user-facing APIs, cold starts over 200ms are noticeable; for background jobs, they're irrelevant.
15 minutes (900 seconds). For workloads exceeding this, use AWS Step Functions (orchestrate multiple Lambda calls), ECS Fargate (container-based, no time limit), or AWS Batch. Note that API Gateway's maximum integration timeout is 29 seconds — so any Lambda function responding to HTTP requests through API Gateway must complete in under 29 seconds, regardless of the 15-minute Lambda limit.
Serverless wins for: spiky, unpredictable traffic; event-driven workloads (S3 uploads, queue processing); very low traffic where idle time would waste VPS resources; rapid deployment without ops overhead. VPS wins for: sustained high traffic (50M+ requests/month where serverless costs exceed $50–100 and a $20 VPS can handle the load); long-running processes; WebSocket connections; heavy in-memory caching (Redis); GPU workloads. Use the VPS calculator to compare — the break-even point is typically around 20–50M requests/month for a medium-spec VPS.
The most common hidden costs: (1) AWS API Gateway: $3.50/M REST requests or $1/M for HTTP API — often doubles your Lambda bill. (2) CloudWatch Logs: $0.50/GB ingested, $0.03/GB stored. A verbose API logging 1KB per request at 10M requests/month = 10GB/month = $5 in log ingestion. (3) NAT Gateway: if your Lambda runs in a VPC to access RDS, NAT Gateway charges $0.045/GB processed. (4) Data transfer: $0.09/GB out. (5) Secrets Manager: $0.40/secret/month if you store environment credentials there.