Skip to main contentSkip to calculator

Visual Subnet Calculator

Design your IP subnets visually, export IaC code for all cloud providers, and share with your team

IPv4 Subnet Calculator

/
Select a network type for accurate IP address calculations.

Understanding IP Subnets

What is Subnetting?

Subnetting is the process of dividing a single network into smaller network segments. It helps optimize network performance, improve security, and manage IP address allocation. By breaking down a large network into smaller, more manageable pieces, network administrators can create more efficient routing, isolate network traffic, and implement better security controls.

CIDR Notation

CIDR (Classless Inter-Domain Routing) notation is a method for allocating IP addresses and routing Internet Protocol packets. It replaced the older classful network addressing architecture on the Internet. Its goal was to slow the growth of routing tables on routers across the Internet, and to help slow the rapid exhaustion of IPv4 addresses.

For a complete reference of CIDR notation, subnet masks, and usable IPs, see our CIDR Reference page.

IPv4 CIDR Notation

In IPv4, CIDR notation uses a suffix like /24 to indicate the number of bits in the network portion of an IP address. For example, an IPv4 address like 192.168.1.0 with a /24 suffix means that the first 24 bits (three octets) define the network, leaving the remaining 8 bits for host addresses within that network. This allows for more flexible allocation of IP address blocks compared to the old classful system.

Reserved IPs by Cloud Providers

When planning your cloud infrastructure, it's important to understand that cloud providers reserve certain IP addresses within each subnet for their own use. This affects the number of usable IP addresses available for your resources.

AWS

AWS reserves the first 4 IP addresses and the last IP address in each subnet:

  • The first address is the network address
  • The second address (.1) is used for the VPC router
  • The third address (.2) is for AWS DNS
  • The fourth address (.3) is reserved for future use
  • The last address is the broadcast address

Azure

Azure reserves the first 5 IP addresses and the last IP address in each subnet:

  • The first address is the network address
  • The second address (.1) is reserved for the default gateway
  • The third and fourth addresses (.2, .3) are reserved for Azure DNS
  • The fifth address (.4) is reserved for future use
  • The last address is the broadcast address

Google Cloud

Google Cloud Platform reserves 4 IP addresses in each subnet:

  • The first address is the network address
  • The second address (.1) is reserved as the default gateway
  • The second-to-last address is for future use
  • The last address is the broadcast address

Understanding these reserved addresses is crucial when planning your network architecture, especially when working with smaller subnet sizes where every available IP address counts. Our subnet calculator automatically accounts for these reserved addresses when you select the appropriate cloud provider mode.

Frequently Asked Questions

What is a subnet calculator and how does it work?

A subnet calculator is a tool that helps network administrators calculate IP address ranges, subnet masks, and CIDR notation for network segmentation. It works by taking an IP address and CIDR prefix to determine network boundaries, usable host ranges, and broadcast addresses.

How do I calculate subnet mask from CIDR notation?

To calculate a subnet mask from CIDR notation, convert the prefix length to binary. For example, /24 means 24 bits set to 1, resulting in subnet mask 255.255.255.0. Our calculator automatically converts between CIDR notation and subnet masks.

What's the difference between AWS, Azure, and GCP subnet calculations?

AWS reserves 5 IP addresses per subnet (first 4 and last 1), Azure reserves 5 IPs (first 4 and last 1), while GCP reserves 4 IPs (first 2 and last 2). Our calculator accounts for these cloud-specific requirements automatically.

Can I export subnet configurations as Infrastructure as Code?

Yes! Subnet Expert generates Infrastructure as Code snippets for Terraform, CloudFormation, ARM Templates, and other IaC tools. Simply configure your subnet and click the code export button to get ready-to-use configurations.

How do I share my subnet configuration with my team?

Subnet Expert automatically saves your configuration in the URL. Simply copy and share the URL with your team members, and they'll see the exact same subnet configuration when they open the link.