What is the Serverless / Lambda Cost Calculator?
This tool estimates the monthly cost of running a serverless function such as AWS Lambda, Google Cloud Functions or Azure Functions. Serverless platforms typically bill on two axes: a small charge per request (invocation) and a compute charge measured in GB-seconds — the function's allocated memory multiplied by how long it runs. By entering your traffic, average duration, memory size and the pricing your provider charges, you get a clear monthly estimate before you deploy.
How to use it
Enter your expected monthly requests, the average duration of each invocation in milliseconds, and the memory allocated in MB. Then enter your provider's price per request and price per GB-second. The defaults shown approximate common AWS Lambda on-demand pricing ($0.20 per million requests and roughly $0.0000166667 per GB-second). Always confirm current pricing for your region and provider.
The formula explained
$$\text{Cost} = R \cdot p_r + \left(R \cdot \frac{d}{1000} \cdot \frac{m}{1024}\right) \cdot p_g$$ Duration is converted from milliseconds to seconds (\(\div 1000\)) and memory from MB to GB (\(\div 1024\)). The middle term gives total GB-seconds, which is what compute is billed on.
Worked example
Suppose 1,000,000 requests, 200 ms average duration, 512 MB memory, $0.0000002 per request, $0.0000166667 per GB-second. Request charge $$= 1{,}000{,}000 \times 0.0000002 = \$0.20.$$ GB-seconds $$= 1{,}000{,}000 \times 0.2 \times 0.5 = 100{,}000.$$ Compute charge $$= 100{,}000 \times 0.0000166667 \approx \$1.67.$$ Total \(\approx \$1.87\) per month.
FAQ
Does this include a free tier? No — it shows raw cost. AWS Lambda offers a perpetual free tier (1M requests and 400,000 GB-seconds per month) that you would subtract separately.
Why divide memory by 1024? Pricing is per GB-second, and 1 GB = 1024 MB, so memory in MB is converted to GB before computing GB-seconds.
Are data transfer or storage costs included? No. This estimates only invocation and compute charges; egress, logging and storage are billed separately.