256
addresses
254
hosts
255
255
255
0
192
168
1
0
192
168
1
255
1
254
256
addresses
0
256
addresses
254
hosts
255
255
255
0
192
168
1
0
192
168
1
255
1
254
256
addresses
0
The IP Subnet Calculator is a fundamental networking tool used by network engineers, system administrators, and IT professionals to partition IP address spaces into smaller, manageable subnetworks. Subnetting is at the heart of every modern network architecture, from small office LANs to enterprise data centers and cloud infrastructure. By dividing a larger network into subnets, administrators can improve security through network segmentation, reduce broadcast domain size for better performance, and efficiently allocate limited IPv4 address space.
Internet Protocol version 4 (IPv4) addresses are 32-bit numbers, typically written in dotted-decimal notation as four octets separated by periods (e.g., 192.168.1.0). The CIDR prefix length (Classless Inter-Domain Routing, defined in RFC 4632) specifies how many of the leading bits represent the network portion. The remaining bits identify individual hosts within that subnet. For example, a /24 prefix means 24 network bits and 8 host bits, yielding 256 total addresses (254 usable, since the network address and broadcast address are reserved per RFC 950).
This calculator accepts an IPv4 address in individual octet fields along with a CIDR prefix length and instantly computes the total address count, usable host addresses, the full subnet mask in dotted-decimal form, the network address, the broadcast address, and the number of equivalent /24 subnets contained within the specified block. These results are essential for IP address management (IPAM), firewall rule configuration, VLAN planning, and routing table optimization.
Before CIDR was introduced in 1993 (RFC 1519), IP addressing relied on classful networking — Class A (/8), Class B (/16), and Class C (/24) — which wasted enormous amounts of address space. CIDR allows variable-length subnet masking (VLSM), enabling precise allocation. For instance, a small branch office needing 30 hosts can use a /27 (32 addresses, 30 usable) rather than a full /24, conserving 224 addresses. This calculator supports the full range of prefix lengths from /0 (the entire IPv4 address space) to /32 (a single host route).
Understanding subnet mathematics is critical for network design interviews, certification exams (CCNA, CompTIA Network+, AWS Solutions Architect), and real-world troubleshooting. Common tasks include determining whether two hosts reside on the same subnet, calculating how many subnets can be carved from a given allocation, or finding the valid host range for ACL (Access Control List) configuration. This tool automates these calculations with zero error, saving time and preventing misconfigurations that could lead to routing black holes or security gaps.
Whether you are planning a new office network, configuring cloud VPC subnets in AWS or Azure, setting up Docker bridge networks, or studying for a networking certification, this IP Subnet Calculator delivers the precise answers you need. Enter your IP address and prefix length to get started.
The calculator derives all outputs from the CIDR prefix length using binary arithmetic on 32-bit IPv4 addresses:
Total Addresses:
$$N_{total} = 2^{(32 - \text{prefix})}$$
For a /24 prefix: $$2^{(32-24)} = 2^8 = 256$$ total addresses.
Usable Host Addresses:
$$N_{usable} = 2^{(32 - \text{prefix})} - 2$$
Two addresses are reserved per RFC 950: the network address (all host bits = 0) and the broadcast address (all host bits = 1). Exception: /31 subnets (RFC 3021) use both addresses as point-to-point links, and /32 denotes a single host.
Subnet Mask:
$$M = 2^{32} - 2^{(32 - \text{prefix})}$$
The 32-bit mask value is then split into four octets by successive division by 224, 216, 28, and modulo 256. For /24: mask = 4294967040, which is 255.255.255.0.
Network Address:
$$\text{Network} = \lfloor \text{IP}_{decimal} / \text{BlockSize} \rfloor \times \text{BlockSize}$$
where BlockSize = $$2^{(32 - \text{prefix})}$$. This performs a bitwise AND of the IP with the mask.
Broadcast Address:
$$\text{Broadcast} = \text{Network} + \text{BlockSize} - 1$$
The broadcast address has all host bits set to 1 and is used for layer-3 broadcast traffic within the subnet.
The total addresses represent the mathematical size of the subnet, including the network and broadcast addresses. The usable hosts count is what matters for assigning devices — routers, servers, workstations, printers, and IoT devices each consume one usable address. If the usable count is smaller than your device count, you need a larger subnet (smaller prefix number). The subnet mask in dotted-decimal form (e.g., 255.255.255.0) is what you configure on interfaces and DHCP servers. The network address identifies the subnet in routing tables, while the broadcast address is the destination for packets intended for all hosts on the subnet. The number of /24 subnets helps compare allocations — a /22 contains four /24s, which is useful when planning VLAN assignments. Always leave headroom for growth: if you have 50 devices today, a /26 (62 usable) is tight; a /25 (126 usable) provides room for expansion.
Inputs
Results
A /24 subnet provides 254 usable host addresses (192.168.1.1 through 192.168.1.254). This is the most common subnet size for small to medium office networks and home routers. The network address 192.168.1.0 and broadcast 192.168.1.255 are reserved.
Inputs
Results
A /20 block in a cloud VPC (e.g., AWS default) provides 4,094 usable IPs — enough for hundreds of instances, containers, and load balancers. It contains 16 equivalent /24 subnets, which is useful for further VLAN segmentation within the VPC.
The CIDR prefix length (e.g., /24) specifies the number of leading bits in an IPv4 address that represent the network portion. The remaining bits (32 minus prefix) identify individual hosts. It replaced classful addressing as defined in RFC 4632, enabling variable-length subnet masking (VLSM) for efficient IP allocation.
Per RFC 950, the first address (all host bits = 0) is the network address identifying the subnet, and the last address (all host bits = 1) is the broadcast address for reaching all hosts. Neither can be assigned to devices. Exception: /31 subnets (RFC 3021) use both for point-to-point links.
They express the same information differently. A /24 prefix equals a subnet mask of 255.255.255.0. The mask is a 32-bit number with the first 'prefix' bits set to 1 and the rest to 0. CIDR notation is more compact, while subnet masks are used in device configuration (interfaces, DHCP, routing protocols).
Count the maximum number of devices that will need IP addresses (including routers, switches with management IPs, printers, and future growth). Find the smallest power of 2 that exceeds that count plus 2 (for network and broadcast). For 50 devices, you need at least 52 addresses — use a /26 (64 addresses, 62 usable) or /25 (128, 126 usable) for growth room.
Yes. The calculator works with any IPv4 address. Private ranges defined in RFC 1918 are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. These are used in internal networks, VPCs, and containers. The subnetting math is identical for public and private addresses.
A /32 represents a single host address with no host bits. It is used in routing tables for host routes (e.g., loopback interfaces on routers, /32 assignments in BGP for anycast services, and cloud elastic IPs). There are no usable 'other' hosts — the address is the host.
Variable-Length Subnet Masking (VLSM) allows different subnets within the same network to use different prefix lengths. A point-to-point WAN link needs only a /30 (2 usable IPs), while a user VLAN might use a /23 (510 usable IPs). Without VLSM, you would waste addresses by using a uniform subnet size everywhere.
The wildcard mask is the bitwise inverse of the subnet mask. For /24 (mask 255.255.255.0), the wildcard is 0.0.0.255. It is used in Cisco ACLs and OSPF network statements to specify which bits to match (0 = must match, 1 = ignore). Wildcard = 255.255.255.255 minus subnet mask.
From a /16 block (65,536 addresses), you can create: 256 /24 subnets (254 hosts each), 1,024 /26 subnets (62 hosts each), 4,096 /28 subnets (14 hosts each), etc. The number of subnets equals 2(target_prefix - original_prefix). For /16 to /24: 28 = 256.
This calculator is designed for IPv4 (32-bit addresses). IPv6 uses 128-bit addresses with different subnetting conventions — the standard allocation is a /64 per subnet (264 host addresses). While the binary math concepts are similar, the scale and notation differ significantly. A dedicated IPv6 calculator would be needed for those calculations.
Roboculator Team
The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.
How helpful was this calculator?
Be the first to rate!