June 2026 · Official AWS Lambda pricing

AWS Lambda Cost Calculator

Compare Lambda, Cloudflare Workers, Vercel, and GCP Functions pricing. Enter invocations, duration, memory → see exact monthly bills. Free, no signup.

Advertisement

⚡ Serverless Cost Calculator

Select provider · Enter invocations and duration · Results update live

Estimated monthly cost
$0
per month
Invocation cost
Compute cost
Annual estimate

Serverless Pricing Comparison 2026

Monthly cost for 10M invocations · 256MB · 200ms avg duration.

ProviderFree tierInvocation priceCompute price10M inv / 200ms / 256MB
AWS LambdaMOST POPULAR1M inv/mo + 400K GB-s$0.20/M$0.0000166725/GB-s$3.47
Cloudflare Workers1M req/day (free plan)$0.30/M (paid)$0.012/M GB-s$2.70
Vercel Functions100K GB-s/mo$0.40/M$0.018/GB-s$4.00
GCP Cloud Functions2M inv/mo + 400K GB-s$0.40/M$0.0000250/GB-s$3.20
Advertisement
⚠ Hidden costs

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.

When to Choose Lambda vs Alternatives

Use caseBest choiceReason
REST API · under 30msCloudflare WorkersEdge execution, no cold start
REST API · 100ms–500msAWS LambdaFree tier, mature ecosystem
Heavy compute · 1–5sAWS LambdaUp to 10GB memory, 15min timeout
Next.js / React SSRVercel FunctionsZero-config deployment
Event-driven batchAWS LambdaNative integration with SQS, SNS, S3

How to Use This Calculator

Estimate your serverless compute cost across AWS Lambda, Cloudflare Workers, and Vercel.

  1. 1
    Select your providerAWS Lambda is the industry standard with the broadest ecosystem (native integration with S3, SQS, DynamoDB, etc.) and a generous permanent free tier. Cloudflare Workers executes at the edge with zero cold starts, ideal for sub-50ms API responses. Vercel Functions offer zero-configuration deployment for Next.js apps. GCP Cloud Functions is best if you're already in the Google Cloud ecosystem.
  2. 2
    Enter invocations per monthCount each function call as one invocation. A REST API handling 500 requests/second = 1.3 billion invocations/month (well into paid territory). A background job running every minute = 43,200 invocations/month (free tier on Lambda). A webhook handler receiving 10,000 events/day = 300,000 invocations/month (still within Lambda's free tier). Start with your current or expected request rate.
  3. 3
    Set average durationDuration is how long each function invocation takes to execute. A simple database query + response: 50–100ms. An API call to an LLM or external service: 500–3,000ms. Image processing: 1,000–5,000ms. You can find actual average duration in your cloud provider's monitoring dashboard. If you don't know yet, use 200ms as a reasonable default for typical API handlers.
  4. 4
    Select memory allocationMemory directly affects compute cost and execution speed. More memory = faster CPU allocation in AWS Lambda. For CPU-bound tasks (parsing, computation), allocating more memory can reduce duration enough to lower the total cost despite the higher per-GB-s price. For I/O-bound tasks (database calls, API calls), memory above 256MB rarely reduces duration significantly. Start with 256MB and profile under load.
📌 Real example

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.

Pricing Methodology

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.

Frequently Asked Questions

Is Cloudflare Workers cheaper than AWS Lambda?+

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.

What is the AWS Lambda free tier?+

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.

Does AWS Lambda have cold starts and how bad are they?+

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.

What is the maximum timeout for AWS Lambda?+

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.

When should I use serverless vs a VPS?+

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.

What are the hidden costs of AWS Lambda?+

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.

Advertisement

Related Calculators