Blaze plan only · April 2026

Firebase Cloud Functions Pricing: What Does It Cost to Run Functions?

Cloud Functions are free for most small-to-medium apps — but they require the Blaze plan. Here's exactly what you pay, when you pay it, and the hidden cost most developers miss.

Cloud Functions require the Blaze (pay-as-you-go) plan

Cloud Functions will not deploy or run on the Spark free plan. You must upgrade to Blaze to use them. Upgrading is free and preserves all Spark free tier quotas — see the Spark vs Blaze guide for details.

Cloud Functions Free Tier (Blaze Plan)

The Blaze plan includes a generous monthly free allocation for Cloud Functions. Most small to medium apps never exceed it.

2,000,000
Invocations / month
400,000
GB-seconds compute
200,000
GHz-seconds CPU
5 GB
Outbound egress
Billable unitFree tier (Blaze monthly)Price beyond free tier
Invocations2,000,000 / month
Compute time — memory400,000 GB-seconds
Compute time — CPU200,000 GHz-seconds
Outbound egress5 GB / month
Inbound dataAlways freeAlways free

Cloud Functions v1 vs v2 — Pricing Differences

Firebase supports two generations of Cloud Functions. Google recommends v2 for new deployments. The pricing models differ slightly, but the free tier is comparable.

v1 (1st gen)
  • Node.js / Python / Go runtimes
  • Charged per: invocations + GB-seconds + GHz-seconds
  • Max timeout: 9 minutes
  • Still supported; no new features added
v2 (2nd gen)
Recommended
  • Cloud Run-based architecture
  • Charged per: requests + vCPU-seconds + memory-seconds
  • Max timeout: 60 minutes
  • Faster cold starts, concurrency support, larger memory

Real-World Cost Examples

Webhook handler — 100,000 invocations/month at 500ms, 256 MB
100K < 2M free tier threshold
Fully within free tier. No charge.
$0 / month
Scheduled cron job — every 5 minutes (8,640 invocations/month)
8,640 < 2M free tier threshold
Running hourly or even every minute would still be free.
$0 / month
High-traffic API — 10 million invocations/month
(10M - 2M free) × $0.40 per 1M = $3.20
Invocation cost only. Compute and egress may add more.
~$3.20 / month
Heavy compute — 50M invocations/month, 256 MB, 100ms each
(50M - 2M) × $0.40/M + compute: ≈$24
At this scale, optimise memory allocation and execution time.
~$24–$35 / month

Egress — The Hidden Cloud Functions Cost

Data leaving your functions costs money beyond 5 GB/month. Every response payload, every external API call response, every file returned — counts as egress at $0.12/GB after the first 5 GB. Serving images or large JSON from Cloud Functions instead of directly from Cloud Storage URLs is a common mistake that doubles bandwidth cost.

Example: A function that returns a 50 KB JSON payload, called 200,000 times/month:

// Egress calculation
200,000 calls × 50 KB = 10 GB egress
Free egress: 5 GB
Billable: 10 GB - 5 GB = 5 GB × $0.12 = $0.60/month

How to Keep Cloud Functions Costs Low

Right-size memory allocation
Allocate the minimum memory your function needs. Memory defaults to 256 MB. Dropping to 128 MB for lightweight functions reduces compute cost by 50%.
Avoid unnecessarily large payloads
Return only the data the client needs. Paginate large result sets. Compress responses where possible.
Use minimum instances thoughtfully
Setting min-instances above 0 eliminates cold starts but keeps instances running 24/7. A single always-warm 256 MB instance costs ~$10/month in idle compute.
Serve static assets directly from Cloud Storage
Never proxy static files (images, PDFs, large JSON) through Cloud Functions. Serve them directly from Cloud Storage URLs to avoid double-counting egress.
Use Firebase App Check to block spam invocations
Unauthorized invocations count toward your quota and billing. App Check verifies that requests come from genuine app clients.

Frequently Asked Questions

Cloud Functions are not available on the Spark plan at all. You cannot deploy or run Cloud Functions without upgrading to the Blaze (pay-as-you-go) plan. This is the single most common reason developers upgrade to Blaze.
← Firebase Pricing CalculatorSpark vs BlazeAuth Pricing →Hidden Costs Guide →