IP Subnet Calculator
An IP subnet calculator determines the network address, broadcast address, usable host range, and number of available hosts from an IP address and subnet mask or CIDR notation. Enter an IP address and subnet below to calculate all subnet details instantly.
What Is an IP Subnet Calculator?
An IP subnet calculator is a tool that computes all relevant network parameters from an IP address and a subnet mask or CIDR prefix. Given inputs like 192.168.1.100/24, the calculator outputs the network address, broadcast address, first and last usable host addresses, total usable hosts, wildcard mask, IP class, and the binary representation of the subnet mask. These values are essential for network engineers, system administrators, and anyone configuring routers, firewalls, or cloud infrastructure.
The calculations use bitwise AND and NOT operations on 32-bit integers. The subnet mask is ANDed with the IP address to derive the network address. The wildcard mask (inverse of the subnet mask) is ORed with the network address to produce the broadcast address. All arithmetic is performed on the binary representation of IPv4 addresses.
Subnetting Basics
What Is a Subnet?
A subnet, short for subnetwork, is a logically segmented portion of a larger IP network. Every device on a subnet shares the same network prefix, meaning the first N bits of their IP addresses are identical. Devices within the same subnet can communicate directly without passing through a router. Devices on different subnets must go through a router or layer-3 switch. Subnets are defined by combining an IP address with a subnet mask that specifies how many bits belong to the network portion versus the host portion.
Why Subnetting Is Used
Subnetting improves network performance by limiting broadcast traffic to smaller segments. Broadcasts sent within one subnet do not propagate to other subnets, reducing unnecessary traffic on the wider network. Subnetting also improves security by isolating groups of devices. A server subnet can be separated from a user subnet, and firewall rules can control traffic between them. Additionally, subnetting allows more efficient use of IP address space by allocating only as many addresses as a segment requires rather than assigning large address blocks unnecessarily.
CIDR Notation Explained
What CIDR Means
CIDR stands for Classless Inter-Domain Routing. It is a method of specifying IP address ranges using a prefix length instead of a traditional subnet mask written in dotted decimal. CIDR notation appends a forward slash and a number to the IP address, such as 10.0.0.0/8. The number after the slash indicates how many of the 32 bits in an IPv4 address are used for the network prefix. The remaining bits are available for host addresses within that subnet. CIDR replaced the older classful system in 1993 as defined in RFC 4632 CIDR addressing standard.
CIDR to Subnet Mask Conversion
To convert a CIDR prefix to a subnet mask, fill the first N bits with 1s and the remaining 32-N bits with 0s, then express the result in dotted decimal. For example, /24 means 24 ones followed by 8 zeros: 11111111.11111111.11111111.00000000, which equals 255.255.255.0. A /16 produces 11111111.11111111.00000000.00000000, which is 255.255.0.0. The wildcard mask, used in access control lists and firewall rules, is the bitwise inverse of the subnet mask.
Subnet Mask Chart
| CIDR | Subnet Mask | Usable Hosts | Wildcard Mask |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 | 0.255.255.255 |
| /16 | 255.255.0.0 | 65,534 | 0.0.255.255 |
| /24 | 255.255.255.0 | 254 | 0.0.0.255 |
| /25 | 255.255.255.128 | 126 | 0.0.0.127 |
| /26 | 255.255.255.192 | 62 | 0.0.0.63 |
| /27 | 255.255.255.224 | 30 | 0.0.0.31 |
| /28 | 255.255.255.240 | 14 | 0.0.0.15 |
| /29 | 255.255.255.248 | 6 | 0.0.0.7 |
| /30 | 255.255.255.252 | 2 | 0.0.0.3 |
How to Calculate Subnets
Network Address
The network address is the first address in a subnet and represents the subnet itself rather than any specific device. It is calculated by performing a bitwise AND operation between the IP address and the subnet mask. For example, 192.168.1.100 AND 255.255.255.0 yields 192.168.1.0. The network address cannot be assigned to any device. It is used in routing tables to represent the entire subnet.
Broadcast Address
The broadcast address is the last address in a subnet. Packets sent to this address are delivered to every device on the subnet. It is calculated by performing a bitwise OR between the network address and the wildcard mask. For 192.168.1.0 with wildcard 0.0.0.255, the broadcast address is 192.168.1.255. Like the network address, the broadcast address cannot be assigned to a device.
Usable Host Range
The usable host range is all addresses between the network address and the broadcast address, exclusive. For 192.168.1.0/24, the usable range is 192.168.1.1 through 192.168.1.254, providing 254 addresses. A /24 subnet has 256 total addresses (2^8), minus 2 reserved addresses (network and broadcast), leaving 254 usable hosts. The number of usable hosts for any subnet is 2^(32-prefix) - 2, except for /31 and /32 prefixes which are special cases used for point-to-point links and host routes.
IP Address Classes
Class A, B, C
Before CIDR was introduced, IP addresses were assigned in three main classes based on the value of the first octet. Class A addresses range from 1.0.0.0 to 126.255.255.255, with a default subnet mask of /8 and over 16 million hosts per network. Class B addresses range from 128.0.0.0 to 191.255.255.255, with a default mask of /16 and 65,534 hosts per network. Class C addresses range from 192.0.0.0 to 223.255.255.255, with a default mask of /24 and 254 hosts per network. The address 127.x.x.x is reserved for loopback (localhost) and is not routable. Refer to the IANA IP address space registry for the full allocation table.
Private IP Ranges
Certain IP address ranges are reserved for private use and are not routable on the public internet. These are defined in RFC 1918 and include: 10.0.0.0/8 (Class A private, 16+ million addresses), 172.16.0.0/12 (Class B private, addresses 172.16.0.0 through 172.31.255.255), and 192.168.0.0/16 (Class C private, 65,536 addresses). Home routers and corporate networks typically use these ranges internally. Network address translation (NAT) maps private IP addresses to a public IP when communicating with external servers.
Common Subnets
/24 (255.255.255.0 — 254 hosts)
The /24 subnet is the most commonly used subnet in home networks and small business environments. It provides 254 usable host addresses per subnet and is straightforward to manage. Each /24 block occupies the last octet for host addressing, making it easy to read and plan. A single Class C address block is one /24 subnet. Many cloud providers allocate /24 VPC subnets as standard building blocks, and the Cisco IP addressing and subnetting guide covers /24 configurations extensively.
When network growth requires more addresses than a single /24 provides, administrators typically move to a /23 (510 hosts), /22 (1022 hosts), or /16, or alternatively split the network into multiple /24 subnets with routing between them. Use the bandwidth calculator alongside subnet planning to estimate throughput requirements per segment.
/16 (255.255.0.0 — 65,534 hosts)
The /16 subnet provides 65,534 usable addresses and is commonly used in large corporate networks, data centers, and cloud VPCs. Amazon Web Services and Google Cloud Platform both allow /16 VPC CIDR blocks as the largest supported private range per virtual network. A /16 can be subdivided into 256 /24 subnets or any combination of smaller subnets for departmental or application-level segmentation. The ability to use a single /16 as the parent and allocate /24 child subnets per department simplifies routing table management significantly.
Frequently Asked Questions
What is a subnet mask?
A subnet mask is a 32-bit number that divides an IP address into a network portion and a host portion. Written in dotted decimal, common subnet masks are 255.255.255.0 (for /24), 255.255.0.0 (for /16), and 255.0.0.0 (for /8). The subnet mask is applied to an IP address using a bitwise AND operation to determine the network address.
How do I calculate a subnet?
To calculate a subnet, convert the IP address and subnet mask to 32-bit binary. Perform a bitwise AND between them to get the network address. Invert the subnet mask bits to get the wildcard mask, then OR it with the network address to get the broadcast address. The usable host range is all addresses between the network and broadcast addresses, exclusive. This calculator performs all these steps automatically.
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation expresses a subnet as an IP address followed by a forward slash and the number of network prefix bits, such as 192.168.1.0/24. The number after the slash tells you how many bits are fixed for the network portion, with the remaining bits available for hosts. /24 means 24 bits are the network prefix and 8 bits are for hosts, giving 254 usable addresses.
How many hosts are in a /24 subnet?
A /24 subnet has 256 total addresses (2 to the power of 8). Two addresses are reserved: the network address (first) and the broadcast address (last). This leaves 254 usable host addresses. For comparison, a /25 has 126 usable hosts, a /26 has 62, and a /30 has only 2 usable hosts, which is typically used for point-to-point links between routers.
What is a broadcast address?
The broadcast address is the last address in a subnet. Packets sent to the broadcast address are delivered to all devices on that subnet. It is calculated by combining the network address with the wildcard mask using a bitwise OR operation. For the subnet 192.168.1.0/24, the broadcast address is 192.168.1.255. The broadcast address cannot be assigned to any device.