Cloud Functions Execution Cost Calculator
Know your serverless bill before it arrives.
Enter monthly invocations, memory allocation, average execution duration, and outbound networking. The calculator applies 2026 Cloud Functions for Firebase pricing — invocations, compute (GB-seconds), CPU (GHz-seconds), and egress — and shows your full cost breakdown after the free tier deduction.
Monthly usage inputs
How Cloud Functions for Firebase billing works
Cloud Functions for Firebase (1st gen) charges on four independent meters. Understanding how compute time is calculated — not just invocation count — is the key to avoiding billing surprises.
$0.40 per million after 2M free
Each time a function is triggered (HTTP request, Firestore trigger, Auth trigger, Pub/Sub message, etc.) counts as one invocation. The free tier of 2 million invocations per month resets monthly. At typical trigger rates, invocations are rarely the largest cost driver — compute time usually dominates.
$0.0000025 per GB-second after 400K free
GB-seconds = (memory in GB) × (duration in seconds), billed in 100ms increments. A 256 MB function running for 500ms = 0.25 GB × 0.5s = 0.125 GB-seconds. The free tier of 400,000 GB-seconds covers 1.6 million invocations of this function before billing starts.
$0.0000100 per GHz-second after 200K free
CPU allocation scales with memory. At 256 MB you get 0.2 GHz; at 1 GB you get 0.6 GHz. A 256 MB function running 500ms uses 0.2 GHz × 0.5s = 0.1 GHz-seconds. The free tier is 200,000 GHz-seconds. CPU cost is typically smaller than memory cost but adds up for high-compute functions.
$0.12 per GB after 5 GB free
Data sent from your function to external services (APIs, third-party webhooks, email providers) is billed as outbound networking. Traffic to other Google Cloud services in the same region is free. The 5 GB/month free tier covers light API usage. Functions that proxy large payloads or send emails with attachments can make networking the dominant cost.
Cloud Functions pricing reference (2026)
| Meter | Free tier | Paid rate |
|---|---|---|
| Invocations | 2,000,000 / month | $0.40 / million |
| Compute (GB-seconds) | 400,000 GB-s / month | $0.0000025 / GB-s |
| CPU (GHz-seconds) | 200,000 GHz-s / month | $0.0000100 / GHz-s |
| Outbound networking | 5 GB / month | $0.12 / GB |
Cloud Functions 1st gen pricing as of 2026. 2nd gen (Cloud Run-based) uses different pricing — CPU is charged separately and has different free tier amounts. Duration is billed in 100ms increments, rounded up. Source: Firebase and Google Cloud pricing documentation.
Memory and CPU allocation
CPU allocation scales automatically with memory in Cloud Functions 1st gen. Higher memory gives more CPU, which can reduce execution time enough to lower your total cost.
| Memory | CPU | GB-s per 100ms | Best for |
|---|---|---|---|
| 128 MB | 0.083 GHz | 0.0128 GB-s | Lightweight I/O tasks |
| 256 MB (default) | 0.167 GHz | 0.0256 GB-s | Most Firebase triggers |
| 512 MB | 0.333 GHz | 0.0512 GB-s | Image processing lite |
| 1 GB | 0.583 GHz | 0.1 GB-s | Moderate compute |
| 2 GB | 1.0 GHz | 0.2 GB-s | Heavy processing |
GB-s and GHz-s per 100ms are approximate. Actual billing rounds execution duration up to the nearest 100ms per invocation.
How to use this calculator
Pull metrics from Firebase console
Open Firebase console → Functions → Dashboard. The invocation count for the current month appears per function. Sum across all functions for a total. For new projects, estimate from expected triggers: HTTP functions = requests/month, Firestore triggers = expected write/delete operations.
Use the p50 execution time
The Functions dashboard shows execution time percentiles. Use p50 (median) for cost estimation, not p95. Cold starts inflate p95 significantly but represent a small fraction of invocations in a steady-state app. For new projects, 200–500ms is typical for Firestore-triggered functions.
Only count external traffic
Traffic to Firestore, Firebase Auth, and other Google Cloud services in the same region is free. Only count traffic to external APIs, email services, SMS gateways, and third-party webhooks. A function that only reads/writes Firestore typically has near-zero billable egress.
Watch function invocations on your phone
Once live, Firepulse shows Cloud Functions invocation counts and error rates across all your Firebase projects. Get a daily digest notification before a runaway trigger function inflates your month-end bill. Free on Google Play.
FAQ
How are Firebase Cloud Functions billed?
Cloud Functions 1st gen charges on four meters: (1) invocations at $0.40/million after 2M free; (2) compute at $0.0000025/GB-s after 400K free; (3) CPU at $0.0000100/GHz-s after 200K free; (4) outbound networking at $0.12/GB after 5 GB free. All meters have separate free tiers that reset monthly.
What is a GB-second?
GB-seconds = memory in GB × execution time in seconds. A 256 MB function (0.25 GB) running 500ms = 0.125 GB-seconds. The free tier of 400,000 GB-seconds covers 3.2 million such invocations per month. Duration is billed in 100ms increments, always rounded up.
Does more memory cost more?
More memory costs more GB-seconds per second but provides more CPU, which can reduce execution time. A 512 MB function completing in 100ms costs the same GB-seconds as a 256 MB function completing in 200ms. For CPU-bound tasks, increasing memory can reduce total cost by cutting duration.
Is my data saved when I use this calculator?
All calculations happen locally in your browser. Inputs are saved to localStorage under fp-cloudfunctionscostcalculator-v1 so they persist across page refreshes. Nothing is ever sent to any server.
Related Firepulse tools
Monitor Cloud Functions live — on your phone
Firepulse delivers daily Firebase metrics to your phone. Catch runaway functions before month-end billing surprises.