Skip to content
ENExplore Calculators

Cloud Functions Cost Calculator

Estimate Cloud Functions cost from invocations, memory and duration with 100 ms rounding and the free tier applied.

About Cloud Functions Cost Calculator

Cloud Functions bills three meters at once: a flat charge per invocation and two resource meters derived from execution time, one for memory and one for CPU. Because time is rounded up to the next 100 ms, a function that finishes in 130 ms is billed for 200, so short functions pay a large rounding premium that the waste figure here quantifies. Memory and CPU are linked to the same duration term, so shaving milliseconds cuts two lines of the bill at once, while over-allocating memory raises cost with no latency benefit unless the function is memory bound. Verify the per-GB-second and per-invocation prices for your region in the Google Cloud pricing calculator, and note that the free tier is per billing account.

Formula

Cloud Functions Cost

cost = (invocations − free) ÷ 1,000,000 × invocation price + (GB-seconds − free) × GB-second price + (GHz-seconds − free) × GHz-second price, where duration is rounded up to the next 100 ms.

GB-seconds
Memory in GB multiplied by rounded execution seconds, summed over invocations
GHz-seconds
CPU allocation multiplied by the same rounded seconds
100 ms rounding
Every invocation is billed in whole 100 ms increments

Worked example

With the default values below, Cloud Functions Cost Calculator returns Monthly Cost of $80.60. Change any input above and every figure here is recalculated in your browser.

Inputs used

Invocations per monthaccepts 0–1,000,000 millions
20 millions
Average execution timeaccepts 1–540,000 ms
400 ms
Memory allocatedaccepts 128–32,768 MB
512 MB
CPU allocatedaccepts 0.1–8 GHz
0.8 GHz
Price per million invocationsaccepts 0–100 USD/million
0.4 USD/million
Price per GB-secondaccepts 0–1 USD/GB-s
0.000003 USD/GB-s
Price per GHz-secondaccepts 0–1 USD/GHz-s
0.00001 USD/GHz-s
Free invocationsaccepts 0–1,000 millions
2 millions
Free GB-secondsaccepts 0–100,000,000 GB-s
400,000 GB-s
Free GHz-secondsaccepts 0–100,000,000 GHz-s
200,000 GHz-s
Outbound network egressaccepts 0–1,000,000 GB
20 GB
Egress price per GBaccepts 0–5 USD/GB
0.12 USD/GB

Results

Monthly Cost
$80.60
Invocation Charge
$7.20
Memory (GB-second) Charge
$9.00
CPU (GHz-second) Charge
$62.00
Egress Charge
$2.40
Billed GB-Seconds
3,600,000 GB-s
Time Paid for but Not Used
0.0%
Cost per Million Invocations
$4.0300

Step by step

  1. 1Values used
  2. 2Cloud Functions Cost
  3. 3Monthly Cost= 80.60
  4. 4Invocation Charge= 7.20
  5. 5Memory (GB-second) Charge= 9.00
  6. 6CPU (GHz-second) Charge= 62.00
  7. 7Egress Charge= 2.40
  8. 8Billed GB-Seconds= 3,600,000 GB-s

Assumptions and limits

  • The result is derived only from the 12 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 4 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

How is Cloud Functions Cost calculated?

cost = (invocations − free) ÷ 1,000,000 × invocation price + (GB-seconds − free) × GB-second price + (GHz-seconds − free) × GHz-second price, where duration is rounded up to the next 100 ms. Cloud Functions bills three meters at once: a flat charge per invocation and two resource meters derived from execution time, one for memory and one for CPU. Because time is rounded up to the next 100 ms, a function that finishes in 130 ms is billed for 200, so short functions pay a large rounding premium that the waste figure here quantifies.

Why does Cloud Functions Cost matter?

Memory and CPU are linked to the same duration term, so shaving milliseconds cuts two lines of the bill at once, while over-allocating memory raises cost with no latency benefit unless the function is memory bound. Verify the per-GB-second and per-invocation prices for your region in the Google Cloud pricing calculator, and note that the free tier is per billing account.

What values do I need to enter?

This calculator takes 12 inputs: Invocations per month, Average execution time, Memory allocated, CPU allocated, Price per million invocations, Price per GB-second, Price per GHz-second, Free invocations, Free GB-seconds, Free GHz-seconds, Outbound network egress, Egress price per GB. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.

Is more memory ever cheaper?

Sometimes. Gen 1 scales CPU with the memory tier, so doubling memory can more than halve execution time on CPU-bound work. Because both meters multiply by duration, the faster, larger configuration can bill less overall — test it rather than assuming.

Cloud Functions Cost Calculator | Calcrivo