Serverless functions charge for two things: the number of requests and the compute time used. Many cloud platforms grant a free tier each month, but large workloads can still add up. This tool helps you project costs before deploying a new service. You simply enter how many times your function will run, the average runtime in milliseconds, and the memory allocated. Pricing fields let you adapt the calculation to any provider, whether itโs AWS Lambda, Azure Functions, or Googleโs Cloud Functions.
The cost equation in MathML format looks like this:
Where is the number of invocations, is memory in megabytes, is runtime in milliseconds, is price per million requests, and is price per gigabyte-second. The expression converts memory to gigabytes and runtime to seconds, then multiplies by the compute price. Adding the request charge gives your monthly estimate.
After running the numbers, you might discover a function costs more than expected. Consider reducing memory if the task is lightweight or rewriting code to execute faster. Batching events can also help if latency is not critical. The more efficiently your function runs, the less youโll pay. Many teams start with generous memory allocations and gradually dial them back. Use this calculator regularly to test how code changes influence your bill.
Invokes | Runtime | Memory | Monthly Cost |
---|---|---|---|
1M | 200ms | 512MB | $18.40 |
5M | 100ms | 256MB | $16.00 |
10M | 50ms | 128MB | $10.50 |
The figures above assume pricing similar to AWS at the time of writing. Your own costs may differ depending on region, provider, or whether you receive extra free tier credits. The purpose here is to give you a quick reference as you architect scalable applications.
Parse cron expressions to human-readable text with our Cron Expression Helper tool.
Generate tailored .gitignore files for your projects by selecting common templates and combining them with ease.
A tool to visualize colors as seen by individuals with common color vision deficiencies. Includes educational material on color blindness and accessibility considerations.