Subnetcalculator

GCP Subnet Calculator

Size Google Cloud VPC subnets with the 4 reserved addresses (first two, last two) already subtracted from usable-host counts.

IPv4 Subnet Calculator

Private (RFC 1918)

Paste CIDR notation (e.g. 10.0.0.0/22) to set the mask automatically

GCP mode: usable-host counts subtract the 4 addresses GCP reserves in every subnet (minimum subnet size /29).

Results update instantly as you type

Results

Network Map

10.128.0.0
10.128.0.255
Network Address
The starting address of your subnet
Broadcast Address
The final address of your subnet
Usable IP Addresses
252 addresses you can assign to devices
GCP Reserved
IPs reserved by GCP in your subnet

Summary

Your Network
10.128.0.0/24
Subnet Mask
255.255.255.0
Wildcard Mask
0.0.0.255
First Usable IP
10.128.0.2
Last Usable IP
10.128.0.253
Total Usable IPs
252
Next Network
10.128.1.0

GCP Reserved IPs

Google Cloud reserves 4 IP addresses in every subnet: the first two and the last two.

Network: 10.128.0.0
Default Gateway: 10.128.0.1
Second-to-last (reserved): 10.128.0.254
Broadcast: 10.128.0.255
Advanced: View Binary Representation

IP addresses are stored as binary numbers (1s and 0s) in computers. This is how your network looks in binary:

IP Address
00001010.10000000.00000000.00000000
Subnet Mask
11111111.11111111.11111111.00000000
Network
00001010.10000000.00000000.00000000
Broadcast
00001010.10000000.00000000.11111111

Advanced Features

🔍 Compare Two Subnets

Compare two subnets to see if they overlap, contain each other, or are completely separate.

Comparison Results

Subnet 1
192.168.1.0/24
Range: 192.168.1.0 - 192.168.1.255
Subnet 2
192.168.2.0/24
Range: 192.168.2.0 - 192.168.2.255
Separate Subnets

The subnets are completely separate - they do not share any IP addresses.

🧮 VLSM Calculator (Variable Length Subnet Masking)

Create multiple subnets of different sizes from a single network. VLSM optimizes IP address utilization by allocating exactly the right subnet size for each requirement.

VLSM Benefits:

  • • Reduces IP address waste by up to 80%
  • • Automatically calculates optimal subnet sizes
  • • Perfect for complex network designs
  • • Supports up to 100 different subnet requirements

Need to Validate IP Addresses?

Before configuring your subnets, ensure your IP addresses are properly formatted with our comprehensive IP validator. Supports both IPv4 and IPv6 with detailed analysis and error detection.

Validate IP Addresses

Also see: general subnet calculator · AWS subnet calculator · Azure subnet calculator

GCP reserves 4 IPs per subnet — and they're not where you expect

Google Cloud takes fewer addresses than AWS or Azure, but it takes them from both ends of the range. In a 10.128.0.0/24 subnet:

  • 10.128.0.0Network address — the first address of the primary range.
  • 10.128.0.1Default gateway — the second address, always the subnet's gateway. VMs learn it via DHCP; you never configure a gateway VM.
  • 10.128.0.254Second-to-last address — reserved by Google. This is the one that surprises people used to AWS/Azure, where the reservations all sit at the bottom of the range.
  • 10.128.0.255Broadcast address — the last address of the range.

A /24 therefore yields 252 usable IPs and the minimum subnet, a /29, yields 4. When you script address assignments, remember the usable block ends at .253, not .254.

Regional subnets and in-place expansion

GCP subnets are regional, not zonal. One subnet spans every zone in its region, so instances in us-central1-a and us-central1-f can share a single range. If you're arriving from AWS, this collapses the usual subnet-per-AZ sprawl: one subnet per region per tier is often enough, which means fewer, larger ranges in your IP plan.

Undersized anyway? GCP is the only major cloud where that's routinely fixable in place: gcloud compute networks subnets expand-ip-range grows a subnet's primary range without touching running VMs. Expansion is one-way — you can go from /24 to /20 but never back — and the enlarged range must not collide with other subnets, peered VPCs, or routes. Secondary ranges (used for GKE pods and services as alias IPs) follow their own rules and are planned separately from the primary range this calculator sizes.

Auto-mode VPCs and the 10.128.0.0/9 trap

A new project's default network is an auto-mode VPC: Google pre-creates one /20 subnet per region, all drawn from 10.128.0.0/9 (10.128.0.0 through 10.255.255.255). That entire half of 10/8 is exactly where many corporate networks already live, so the first VPN or Interconnect back to on-prem — or peering with another auto-mode VPC — dies on overlapping routes. Because claimed auto-mode ranges can't be changed, the fix is preventive: create custom-mode VPCs, allocate subnet ranges from your org-wide IPAM plan, and use this calculator to verify each range's usable capacity before you commit it. Existing auto-mode networks can be converted to custom mode (irreversibly), which at least stops new regions from claiming more of 10.128.0.0/9.

GCP Subnet FAQ

How many usable IPs are in a /24 GCP subnet?

252. Google Cloud reserves 4 addresses per subnet — the network address (.0), the default gateway (.1), the second-to-last address (.254), and the broadcast address (.255) — leaving 252 assignable IPs in a /24. That's one more than AWS or Azure, which each reserve 5.

Which IP addresses does Google Cloud reserve in a subnet?

Four per primary IPv4 range: the first address (network), the second address (subnet default gateway), the second-to-last address (reserved by Google for potential future use), and the last address (broadcast). Everything in between is assignable to VMs, internal load balancers, and other resources.

Can I expand a GCP subnet without downtime?

Yes. Run 'gcloud compute networks subnets expand-ip-range SUBNET_NAME --region=REGION --prefix-length=NEW_PREFIX' to grow a subnet's primary range in place — existing VMs keep their IPs and stay running. You can only expand (to a smaller prefix number), never shrink, and the new range must not overlap other subnets or peered networks.

Should I use auto mode or custom mode VPC networks in GCP?

Custom mode for anything serious. Auto mode carves one /20 per region out of 10.128.0.0/9, which very commonly overlaps on-prem 10.x address space and blocks VPC peering or VPN connectivity later. You can convert an auto-mode network to custom mode (one-way), but you cannot change the ranges it already claimed, so starting in custom mode is cleaner.

More Network Tools

Free tools for network engineers — no signup, no rate-limit walls.