HomeToolsLearn › Serverless Function Cost Calculator
cheapest / month
GB-seconds / month
AWS Lambda
most expensive

Same workload, every platform

Monthly cost after each provider's free tier, for the inputs above.

PlatformRequest feeCompute feeFree tier savesMonthly
⚠️ Estimate. Prices are reference figures (July 2026) for the standard x86 / on-demand tier and vary by region and plan. Cloudflare Workers bills CPU time (set above), not wall-clock duration, and assumes the $5/mo Paid plan. Confirm in each provider's pricing page and your own bill. · Report outdated price →

Requests are cheap — compute time is the bill

It's tempting to size a serverless bill by request count, because that's the number everyone quotes. In practice the per-request fee is the small part: AWS Lambda charges $0.20 per million requests, so even ten million calls is two dollars. The real money is GB-seconds — your allocated memory multiplied by how long each call runs, summed over every invocation. A 512 MB function that runs 200 ms burns 0.1 GB-seconds a call; at five million calls that's 500,000 GB-seconds, and after the free tier that compute line dwarfs the request line. Double the memory or let the function idle on a slow API call and the bill doubles with it. This calculator separates the two so you can see which one is actually driving your cost before you start optimising the wrong thing.

The platforms also price compute differently enough to matter. AWS Lambda and Azure Functions both bill wall-clock duration and include a million requests plus 400,000 GB-seconds free each month — generous for low traffic. Google Cloud Functions is in the same family with a slightly different rate and a larger request free tier. Cloudflare Workers is the odd one out: it bills CPU time, not the wall-clock time your function spends waiting on the network, which makes it dramatically cheaper for I/O-bound work that mostly sits idle awaiting a database or upstream API. Once you know the serverless number, compare it against always-on compute with the self-hosted vs API calculator, price the data leaving your function with the cloud egress calculator, and cost the APIs it calls with the API request cost calculator.

How to use it

1. Enter your monthly request volume and the average duration of one invocation in milliseconds.
2. Pick the memory you allocate — this is the biggest lever on the compute bill.
3. Set how much of that duration is actual CPU time (Cloudflare bills only this; for a function waiting on I/O it's a fraction of the wall-clock time).
4. Read the cheapest platform, the GB-seconds, and compare all four in the table.

Common mistakes

Over-provisioning memory. Allocating 1 GB "to be safe" doubles GB-seconds versus 512 MB — and on Lambda more memory also means more CPU, so test the sweet spot. Ignoring idle wait. A function blocked on a slow database is billed for the wait on Lambda/Azure/GCP; Cloudflare isn't. Forgetting the free tier. At low volume the whole bill can be zero — the table shows what the free tier covers. Counting requests, not compute. The request fee is rounding error next to GB-seconds for anything but the shortest functions.

FAQ

What exactly is a GB-second?

One gigabyte of allocated memory held for one second. Memory (in GB) × duration (in seconds) × number of invocations gives the monthly total. It's the unit AWS, Azure and GCP bill compute on.

Why does Cloudflare look so cheap?

Workers bills CPU time, not the wall-clock time your code spends awaiting network calls. An endpoint that waits 200 ms on a database but only uses 5 ms of CPU is billed for ~5 ms — a fraction of what duration-based platforms charge.

Do cold starts cost extra?

Not as a separate line, but a cold start lengthens that invocation's duration, which raises its GB-seconds. Heavy runtimes and large packages make cold starts longer and therefore slightly pricier.

Does this include data transfer?

No — egress (data leaving the platform) is billed separately. Estimate it with the cloud egress cost calculator.

Estimate only. Serverless prices vary by region, tier and runtime — verify on each provider's pricing page before relying on them.

Host your project:DigitalOcean — $200 free ↗Hostinger VPS
CAPTCHA Solving CostWeb Scraping API CostObject Storage (S3) CostAPI Gateway CostAPI Request Cost Calculator