Cloud costs · EC2 and Lambda

EC2 vs Lambda break-even calculator.

An always-on EC2 instance costs the same whether it is busy or idle. Lambda costs more the more it runs. Find the monthly invocation count where the two cost the same.

A t3.small in US East ($0.0208 an hour, $15.18 a month) costs the same as a 512 MB, 200 ms Lambda function at about 8 million invocations a month, roughly 3.1 per second averaged. An m5.large breaks even near 38 million.

Advertisement

Your numbers

Your numbers

Result

Method and limits

Formula. EC2 monthly cost = hourly on-demand Linux price x hours x instances. Lambda monthly cost = invocations x ($0.0000002 + duration in seconds x memory in GB x the per-GB-second rate). The break-even is the invocation count where Lambda equals the EC2 cost, found by solving that equation including the volume tiers. The Lambda free tier is left out so the comparison is a clean list-price one.

Caveat. This is price against price. It assumes one instance can handle all of that traffic, and it ignores everything else on the bill: EBS volumes, load balancers, data transfer, Reserved Instance or Savings Plan discounts (which move the EC2 side down) and the time you spend patching servers. A function that sits idle most of the day favours Lambda; steady high traffic favours the instance.

Price date. List prices in USD, on-demand and pay-as-you-go, retrieved 2026-10-16 and stored in this page. Providers change prices without notice, so confirm on the provider's pricing page before you commit spend. Nothing you type leaves your browser.

Sources

FAQ

When is Lambda cheaper than EC2?

When the function runs less than the break-even volume. The lower the traffic and the shorter and smaller each invocation, the more Lambda wins. This page finds the exact crossover for your instance, memory size and duration.

Does Lambda have a fixed monthly cost?

No. It is pay per request and per GB-second, with a free tier. EC2 on-demand bills every hour the instance runs, busy or not.

Does the break-even include Savings Plans?

No. Savings Plans and Reserved Instances lower the EC2 price, which moves the break-even toward fewer invocations. Use the on-demand figure as a ceiling.

How many hours are in a month?

This page defaults to 730 hours, the average month figure AWS uses in its monthly estimates. Change it if the instance runs part-time.

Why does memory size matter?

Lambda bills duration multiplied by memory, so doubling memory doubles the compute charge for the same run time, though more memory also gives more CPU and can shorten the run.

Advertisement
Advertisement