Free Tool

Lambda vs Container Cost Calculator

Stop guessing on compute costs. Compare Lambda vs Fargate side-by-side — enter your requests per day and execution time, and get a real monthly cost breakdown in under 60 seconds.

Step 1 of 3 33%

What type of workload?

This helps us estimate realistic execution patterns for each option.

Who This Tool Is For

Engineers, architects, and tech leads deciding how to deploy a new workload on AWS — or re-evaluating an existing one. If you've been told "just use Lambda" or "put it in a container" without seeing the numbers, this calculator gives you a concrete cost basis for the conversation. It's also useful for CTOs and engineering managers who need to justify compute architecture choices to finance teams.

Why We Built This Tool

Lambda and Fargate are priced in completely different units — per-invocation versus per-vCPU-hour — which makes direct comparison harder than it should be. Most teams default to whichever option the first engineer on the project was familiar with, not the one that's actually cheaper for their traffic pattern. This tool normalizes the pricing models so you can compare apples to apples in under a minute.

What Problem It Solves

  • Cost visibility before you build. Know whether Lambda or Fargate is cheaper for your expected traffic before writing a line of infrastructure code.
  • Breakeven analysis. See the exact request volume where Fargate becomes cheaper than Lambda — so you know when to reconsider architecture as you scale.
  • Architecture decision support. Turn a subjective debate into a data-backed recommendation you can present to stakeholders.
  • Migration ROI estimate. If you're already on one compute model and considering a switch, this gives you a rough monthly delta to weigh against migration effort.

Read our detailed writeup: AWS Lambda vs ECS Fargate — a practical comparison from engineers who run both in production. Or explore our serverless and container consulting services.

Frequently Asked Questions

At what traffic volume does Fargate become cheaper than Lambda?

There is no universal crossover — it depends on execution duration and memory. For a typical API workload (500ms, 512 MB), Lambda and Fargate reach cost parity at roughly 5–8 million requests per month. Below that threshold Lambda is almost always cheaper because you pay nothing when idle. Above it, Fargate's flat per-hour rate beats Lambda's per-invocation overhead. Use the calculator above with your own numbers to find the exact breakeven for your workload.

Does this calculator account for Lambda cold starts?

No. Cold start latency is a performance concern, not a direct cost driver — Lambda bills on actual execution time, not wait time. However, if you use Lambda Provisioned Concurrency to eliminate cold starts, that adds cost (~$0.0000646 per GB-hour provisioned). For most API workloads, the latency tradeoff is the bigger consideration. See our Lambda vs Fargate comparison for a detailed cold start analysis.

Why doesn't the calculator include EC2?

EC2 pricing depends heavily on instance type, Reserved Instance commitment, and steady-state utilization — variables that require a separate model. As a rough benchmark: a t3.small On-Demand runs ~$17/month, a t3.medium ~$34/month, a c6g.xlarge ~$100/month (us-east-1). For sustained, high-throughput workloads, EC2 with 1-year RIs typically beats Fargate by 30–50%.

Is the Fargate model accurate for always-on services?

The calculator models Fargate as task-per-request, which reflects the true per-execution cost and makes it comparable to Lambda's invocation model. If you run Fargate as a long-running service (tasks always up, Load Balancer in front), the cost structure is different — you pay for the full vCPU-hour even when requests are low. That always-on model can be 2–5× more expensive than the per-execution estimate shown here for bursty workloads.

Does Lambda have a free tier that affects these numbers?

Yes. AWS Lambda includes a permanent free tier of 1 million requests per month and 400,000 GB-seconds of compute time. This is not reflected in the calculator because it applies at the account level and disappears once exceeded. For workloads under 1M requests/month, your actual Lambda bill may be $0. Fargate has no free tier.

Should I use Lambda or Fargate for a background job that runs every 5 minutes?

Lambda is almost certainly cheaper and simpler. A job running every 5 minutes executes 8,640 times per month. Even at 60 seconds and 1 GB memory, Lambda compute cost is roughly $0.86/month. However, if the job regularly exceeds 5–10 minutes or approaches Lambda's 15-minute hard limit, Fargate scheduled tasks are the safer architectural choice.

50+
Serverless migrations
35%
Avg compute cost reduction
AWS Select
Tier Partner