Requests vs compute
Short, light functions are request-bound, long or memory-heavy ones flip to compute-bound.
Home / Dev & AI / AWS Lambda Cost Calculator
Cloud Cost
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
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.
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.
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.
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).
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:
| Memory | Avg duration | GB-seconds per 1M | Compute cost per 1M | With requests |
|---|---|---|---|---|
| 128 MB | 1,000 ms | 125,000 | $2.08 | $2.28 |
| 512 MB | 250 ms | 125,000 | $2.08 | $2.28 |
| 1,024 MB | 140 ms | 140,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.
A function is rarely the biggest line on a serverless bill. Check what sits around it:
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.
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.
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.
Per second, yes, but more memory also means more CPU, so functions often finish faster. Sometimes higher memory lowers total cost by cutting duration.
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.
They are July 2026 estimates for x86. Arm (Graviton) Lambda is cheaper. Confirm current rates for your region on the AWS pricing page.
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.