💰Serverless Invocation Cost Calculator

Enter monthly invocations, duration, and memory to estimate your serverless function cost.

ItemValue
Request Cost$0
Compute Cost (GB-seconds)$0
Total GB-seconds0

Serverless Isn't Free — Do the Math First

It's tempting to assume that "no server management" means cost automatically takes care of itself, but serverless billing scales precisely with invocation count, execution duration, and allocated memory. Over-allocating memory or letting a function run longer than it needs to are both common ways costs creep up without any real traffic growth.

This calculator mirrors AWS Lambda's actual pricing structure: it multiplies monthly invocations by average duration and allocated memory to get GB-seconds of compute, then applies the per-request rate ($0.20 per million) and per-GB-second rate ($0.0000166667). The monthly free tier — 1 million requests and 400,000 GB-seconds — is subtracted automatically before any cost is charged.

If the estimate feels high, start by optimizing your code to reduce execution time or trimming memory that's allocated larger than it needs to be. Duration and memory don't scale inversely in a simple way, so real profiling is the key to finding the cheapest memory setting.

Frequently Asked Questions

How is the free tier factored in?

Based on AWS Lambda, the first 1 million requests and 400,000 GB-seconds of compute each month are free, and this calculator only charges for usage beyond that.

What does GB-second mean?

It is the allocated memory in gigabytes multiplied by the actual execution time in seconds — the base unit used to calculate serverless compute cost.

Do other clouds work the same way?

Google Cloud Functions and Azure Functions use a similar request-count plus GB-second billing structure, so this is a reasonable rough estimate for those too.