Home / Dev & AI / AWS Lambda Cost Calculator

Cloud Cost

AWS Lambda Cost Calculator

Estimate your Lambda bill. Enter invocations, average duration and memory, and see request and compute costs with the free tier applied and a growth projection.

Estimated monthly cost

$0

Request cost—
Compute cost (GB-seconds)—
GB-seconds used—
Cost per 1M invocations—
Annual estimate—

Requests vs compute

Short, light functions are request-bound, long or memory-heavy ones flip to compute-bound.

Cost as invocations grow

Projected monthly spend at 2x, 5x and 10x volume.

What the AWS Lambda Cost Calculator does

AWS Lambda runs your code without managing servers, and it bills on two axes: the number of invocations, and compute measured in GB-seconds, which is memory allocated multiplied by run time. A generous free tier covers the first million requests and 400,000 GB-seconds each month, so low traffic functions can be nearly free.

This Lambda cost calculator computes GB-seconds from your duration and memory, applies the request and compute rates, subtracts the free tier, and shows whether your function is request bound or compute bound. Higher memory speeds execution but raises GB-seconds, so tuning memory is a real optimisation lever.

Heads up on pricing. The rates built into this tool are public list estimates for July 2026 and can change without notice. AWS also offers Arm pricing, Compute Savings Plans and volume tiers that lower real costs, so treat the output as a planning estimate, not a quote.

The formula

GB-seconds = invocations × (duration ÷ 1000) × (memory ÷ 1024)
cost = (billable invocations ÷ 1M × $0.20) + (billable GB-seconds × $0.0000166667)

Worked example

For 10,000,000 invocations at 200 ms and 512 MB, GB-seconds is 10,000,000 × 0.2 × 0.5 = 1,000,000. After the free tier, requests cost 9 × $0.20 = $1.80 and compute is 600,000 × $0.0000166667 = $10, for about $11.80 a month.

Using it for other serverless platforms

Most function-as-a-service platforms bill on the same two meters as Lambda: a price per million invocations and a price per GB-second of compute (memory allocated × run time). Because both prices are editable above, you can price Google Cloud Functions or Azure Functions on the same workload by typing in that provider's current rates and turning off the Lambda free tier. Cloudflare Workers is different: it bills CPU time rather than wall-clock GB-seconds, so a function that mostly waits on the network costs far less there than the GB-second model suggests.

Before the free tier, the worked example above would cost about $18.67 a month ($2.00 requests + $16.67 compute).

Choosing memory: a worked tuning example

Lambda gives a function CPU in proportion to the memory you set, from 128 MB up to 10,240 MB. At about 1,769 MB a function gets the equivalent of one full vCPU. For CPU-bound code, doubling memory can roughly halve the duration, so the GB-seconds and the cost stay about the same while the function responds faster. Here's one image-resizing function measured at three settings, per million invocations:

MemoryAvg durationGB-seconds per 1MCompute cost per 1MWith requests
128 MB1,000 ms125,000$2.08$2.28
512 MB250 ms125,000$2.08$2.28
1,024 MB140 ms140,000$2.33$2.53

Here, 512 MB is the sweet spot: it's four times faster than 128 MB for the same price. Above that the speed-up tails off and the cost rises. For a function that mostly waits on a database or API, extra memory buys almost no speed, so keep the memory low. The open-source AWS Lambda Power Tuning tool runs this test for you automatically.

Arm vs x86 and other Lambda prices

Costs around Lambda that the calculator doesn't include

A function is rarely the biggest line on a serverless bill. Check what sits around it:

When Lambda stops being cheap

A 1 GB function kept busy around the clock uses about 2.59 million GB-seconds a month, around $43 of compute before requests. Once a workload keeps functions busy most of the day, compare it with a container or an always-on instance in the EC2 cost calculator. Steady, predictable load is where servers win. Spiky or low traffic is where Lambda's scale-to-zero pricing wins.

Frequently asked questions

How is AWS Lambda priced?

By invocations at $0.20 per million and compute at about $0.0000166667 per GB-second, where GB-seconds is memory times duration. The first 1M requests and 400,000 GB-seconds each month are free.

What is a GB-second?

One gigabyte of memory allocated for one second. A 512 MB function running two seconds uses one GB-second. It is the core unit of Lambda compute billing.

Does more memory cost more?

Per second, yes, but more memory also means more CPU, so functions often finish faster. Sometimes higher memory lowers total cost by cutting duration.

When is Lambda cheaper than EC2?

For spiky, low or unpredictable traffic, since you pay nothing when idle. For steady high volume, always-on EC2 or containers can be cheaper per request.

Are these rates current?

They are July 2026 estimates for x86. Arm (Graviton) Lambda is cheaper. Confirm current rates for your region on the AWS pricing page.

When is serverless not cost effective?

For steady, high-volume work that would keep functions busy around the clock. At that point an always-on container or VM usually costs less per request, while serverless wins for spiky or low traffic.

Related calculators