GCP VPC
Plan Google Cloud VPC subnet ranges and calculate usable IP addresses per subnet.
About GCP VPC
GCP VPCs are global resources with regional subnets, and can operate in auto mode (a /20 subnet, 4,096 addresses, is automatically created in every region as it becomes available) or custom mode (subnets are manually created with an administrator-chosen size per region). GCP reserves 4 IP addresses per subnet — one fewer than AWS/Azure's 5, since GCP does not carve out a separate reserved address for DNS mapping. Firewall rules in GCP apply at the VPC network level (not per-subnet) but are commonly estimated per-subnet during planning to size out baseline security policies like allow-internal, allow-ssh, and default-deny rules.
Formula
Usable IPs per GCP subnet
usable = 2^(32 − subnet_prefix) − 4
Worked example
With the default values below, GCP VPC returns Usable IPs per Subnet of 252. Change any input above and every figure here is recalculated in your browser.
Inputs used
- VPC Network Modeone of Custom mode (manually defined subnets), Auto mode (one /20 subnet per region automatically)
- Custom mode (manually defined subnets)
- Number of Regionsaccepts 1–40
- 3
- Subnet Prefix (custom mode only)accepts 8–29 /
- 24 /
- Firewall Rules per Subnetminimum 0
- 4
Results
- Usable IPs per Subnet
- 252
- Total Usable IPs (all regions)
- 756
- Estimated Total Firewall Rules
- 12
- Mode Note
- Custom mode requires manually creating a subnet with your chosen prefix in each region you use.
Step by step
- 1Values used
- 2Usable IPs per GCP subnet
- 3Usable IPs per Subnet= 252
- 4Total Usable IPs (all regions)= 756
- 5Estimated Total Firewall Rules= 12
- 6Mode Note= Custom mode requires manually creating a subnet with your chosen prefix in each region you use.
Assumptions and limits
- The result is derived only from the 4 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 whole numbers, 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
What's the difference between GCP auto mode and custom mode VPCs?
Auto mode automatically creates a /20 subnet in every GCP region as it's added, using a predefined IP range — simple but inflexible. Custom mode requires you to manually create each subnet with your chosen CIDR range, giving full control over sizing and avoiding auto mode's fixed /20-per-region allocation.
Why does GCP reserve only 4 IPs instead of 5?
GCP's subnet reservation covers the network address, default gateway, a second-to-last reserved address, and broadcast — it doesn't carve out the extra DNS-mapping address that AWS and Azure each reserve, so GCP subnets yield one more usable address than an equivalently-sized AWS/Azure subnet.
Are GCP firewall rules applied per-subnet like AWS security groups?
No — GCP firewall rules apply at the VPC network level using tags, service accounts, or IP ranges to target specific instances, rather than being directly attached per-subnet. This calculator's per-subnet estimate is a planning simplification to size a baseline rule set.
Can auto mode be converted to custom mode later?
Yes, GCP allows converting an auto-mode VPC to custom mode, but this is a one-way operation — once converted, you cannot switch back to auto mode for that network, so this decision should be made deliberately during initial design.
