Cloud Functions pricing
Cloud Functions are priced according to how long your function runs, how many times it is invoked and how many resources you provision for the function. If your function makes an outbound network request, there are also additional data transfer fees. Cloud Functions includes a perpetual free tier for invocations to allow you to experiment with the platform at no charge. Note that even for free tier usage, we require a valid billing account.
Cloud Functions uses Cloud Build to convert your function source code into an executable image. The images for Cloud Functions are stored in either Container Registry or Artifact Registry. Cloud Functions (2nd gen) exclusively uses Artifact Registry. If your function uses Container Registry, you will incur charges for storing your function's image, even when your use of Cloud Functions falls within the free tier. Artifact Registry has its own free tier of storage. If you deploy your functions to Artifact Registry and exceed the Artifact Registry free tier usage, you will incur charges for deploying your functions, even when your use of Cloud Functions falls within the free tier. For more information about where a function's image is stored, see Building Cloud Functions Images. Pricing for Cloud Build, Container Registry, and Artifact Registry is not included in the Cloud Functions pricing below. To review pricing for these services, see the Cloud Build Pricing, Container Registry Pricing, and Artifact Registry Pricing pages.
Cloud Functions (2nd gen) uses Eventarc for event delivery. Pricing for Eventarc is not included in the Cloud Functions pricing below. Review pricing on the Eventarc Pricing page.
Cloud Functions (2nd gen) pricing is based on Cloud Run pricing. For information about Cloud Run pricing, see the Cloud Run Pricing page.
For information about Firebase Functions pricing, see the Firebase Pricing page.
All prices quoted are in US Dollars. If you pay in a currency other than USD, the prices listed in your currency on Cloud Platform SKUs apply.
Function invocations are charged at a flat rate regardless of the source of the invocation. This includes HTTP function invocations from HTTP requests, events forwarded to background or CloudEvent functions, and invocations resulting from the call API. The pricing tiers shown below are based on the total number of function invocations across all functions associated with a particular Google Cloud Platform billing account.
|Invocations per month||Price/million|
|First 2 million||Free|
|Beyond 2 million||$0.40|
Invocations are charged at a per-unit rate of $0.0000004 per invocation (or $0.40 per million), excluding the first 2 million free invocations per month. You incur charges regardless of the outcome of the function or its duration. You also incur charges for deploying your functions, even if the number of invocations falls within the free tier. For more information about how deployment charges are calculated, see Deployment costs.
Compute time is measured from the time your function receives a request to the time it completes, either through you signaling completion, or through a timeout, other failure or any other termination. Compute time is measured in 100ms increments, rounded up to the nearest increment. For example, a function executing for 260ms would be billed as 300ms.
Fees for compute time are variable based on the amount of memory and CPU provisioned for the function. Units used in this calculation are:
- 1 GB-second is 1 second of wallclock time with 1GB of memory provisioned
- 1 GHz-second is 1 second of wallclock time with a 1GHz CPU provisioned
Disk size, memory, and network usage are calculated in gigabytes (GB), where 1GB is 2^30 bytes. This unit of measurement is also known as a gibibyte (GiB). 1GHz is considered as 10^9 Hertz:
Cloud Functions can be provisioned as one of 7 types:
|Memory||vCPU1||Price/100ms (Tier 1 Price)||Price/100ms (Tier 2 Price)|
1 1 vCPU is equal to 2.4GHz. CPU allocations are an approximation and are subject to change. Actual allocation of CPU clock cycles may vary slightly across function invocations.
More generally, the cost of one second of compute time is as follows:
|Unit||Tier 1 Pricing||Tier 2 Pricing|
($0.0000025 if idle*)
($0.0000035 if idle*)
($0.000001042 if idle*)
($0.00000146 if idle*)
|Regions that have Tier 1 pricing||Regions that have Tier 2 pricing|
If you set a minimum number of function instances, you are also billed for the time these instances are not active. This is called idle time and is priced at a different rate.
Cloud Functions (2nd gen) can take advantage of concurrency, through the underlying Cloud Run service, to give more control over pricing. You can learn more about concurrency in the Cloud Functions (2nd gen) Overview and on the Concurrency page in the Cloud Run documentation.
Cloud Functions provides a perpetual free tier for compute-time resources, which includes an allocation of both GB-seconds and GHz-seconds. In addition to the 2 million invocations, the free tier provides 400,000 GB-seconds, 200,000 GHz-seconds of compute time and 5GB of Internet egress traffic per month. The free tier is measured as a dollar equivalent to the Tier 1 pricing listed above. The equivalent dollar amount is provided whether you run your functions in a region with Tier 1 pricing or Tier 2 pricing or both. However, the deduction of usage of the free tier will be based on whether the region in which the function is running is in Tier 1 or Tier 2.
Note that even for free tier usage, we require a valid billing account.
Outbound data transfer (that is, data transferred from your function out to somewhere else) is measured in GB and charged at a flat rate. Outbound data to other Google APIs in the same region is free, as is inbound data. Google APIs that are global (i.e. not region-specific) are considered to be the same region.
|Outbound Data (Egress)||$0.12|
|Outbound Data per month||5GB Free|
|Inbound Data (Ingress)||Free|
|Outbound Data to Google APIs in the same region||Free|
Cloud Functions provides access to a local disk mount point (
/tmp) which is
known as a "tmpfs" volume in which data written to the volume is stored in
memory. There is no specific fee associated with this however writing data to
/tmp mountpoint will consume memory resources provisioned for the
This section provides some pricing examples and some information about costs incurred as part of the deployment process. For more information on costs associated with Cloud Build, Artifact Registry, or Container Registry, see Building Cloud Functions Images. These examples do not include costs incurred by other Google Cloud products or APIs that you use within your function.
Simple Event-Driven Function
A simple event-driven function with 128MB of memory and a 200MHz CPU, invoked 10 million times per month and running for 300ms each time using only Google APIs (no billable egress).
(128 MB / 1024 MB/GB) x 0.3s = 0.0375 GB-seconds per invocation
(200 MHz / 1000 MHz/GHz) x 0.3s = 0.0600 GHz-seconds per invocation
10,000,000 invocations x 0.0375 GB-seconds = 375,000 GB-seconds per month
10,000,000 invocations x 0.0600 GHz-seconds = 600,000 GHz-seconds per month
|Metric||Gross Value||Free Tier||Net Value||Unit Price||Total Price|
|Total / Month||$7.20|
High Volume HTTP Function
A medium complexity HTTP Function with 256MB of memory and a 400MHz CPU, invoked 50 million times per month via HTTP, running for 500ms each time and sending 5KB of data back to the caller (5KB egress per invocation).
(256 MB / 1024 MB/GB) x 0.5s = 0.125 GB-seconds per invocation
(400 MHz / 1000 MHz/GHz) x 0.5s = 0.200 GHz-seconds per invocation
50,000,000 invocations x 0.125 GB-seconds = 6,250,000 GB-seconds per month
50,000,000 invocations x 0.200 GHz-seconds = 10,000,000 GHz-seconds per month
50,000,000 invocations x (5 KB / 1024 KB/MB / 1024 MB/GB) = 238.42 GB of egress traffic per month
|Metric||Gross Value||Free Tier||Net Value||Unit Price||Total Price|
|Total / Month||$159.84|
Functions are stored in either Container Registry or Artifact Registry. Cloud Functions (2nd gen) exclusively uses Artifact Registry.
If your functions are stored in Container Registry, you'll see small charges after you deploy because Container Registry has no free tier. Container Registry's regional storage costs are currently about $0.026 per GB per month.
Take for example a project deploying fifteen 1st gen Node.js 10 functions that pull in a number of common npm packages. Deploying these functions would result in the use of some free storage, some billed multiregion storage, and a small amount of Cloud Build compute time:
- 1.05 GB of Standard multiregion storage (which has no free tier) in its
REGION.artifacts.*bucket. This multiregion storage space is used by Container Registry.
- 2 MB of
free-tier Cloud Storage
gcf-sources-*bucket. This free storage is used in the function build process.
- Roughly 1 minute of Cloud Build build-minutes per function deploy, which falls within Cloud Build's free tier as long as you don't deploy all fifteen functions more than 8 times per day.
That amounts to $0.03 / month. A charge such as this would show up in your bill as "Standard Storage US Multi-region".
If your functions are stored in Artifact Registry, you won't be charged unless you exceed its free tier of storage. If your function exceeds that limit, you'll see small charges for storage after you deploy.
Since each function's container is stored in an image registry (Container Registry or Artifact Registry) until you delete that function, you would see a small charge every month (unless you use Artifact Registry and fall into its free tier limit).
For more information on costs associated with Cloud Build or Artifact Registry, see Building Cloud Functions Images.
- Read the Cloud Functions documentation.
- Get started with Cloud Functions.
- Try the Pricing calculator.
- Learn about Cloud Functions solutions and use cases.