What is a subnet calculator?
A subnet calculator is a networking tool used to determine the boundaries and addressing information of an IPv4 subnet. Given an IP address and a CIDR prefix, the calculator identifies the network address, broadcast address, subnet mask, wildcard mask, usable IP address range and the number of addresses available within the subnet.
Subnet calculations are commonly used when designing networks, assigning IP addresses, configuring routers and firewalls, troubleshooting connectivity, planning VLANs or preparing for networking certifications. Calculating these values manually requires working with binary addresses and bit boundaries, while an IPv4 subnet calculator performs the calculation instantly.
What is subnetting?
Subnetting is the process of dividing an IP network into smaller logical networks called subnets. Each subnet has its own range of IP addresses and can be used for a particular department, office, server network, VLAN, device group or other part of an organization's network.
Creating smaller subnets can make IP address allocation easier to manage and can help organize network traffic. The size of an IPv4 subnet is determined by its subnet mask or, more commonly today, by its CIDR prefix.
What is CIDR?
CIDR stands for Classless Inter-Domain Routing. It is a method used to describe IP networks and their size using a prefix length. The prefix is written after the IP address with a slash, for example 192.168.1.0/24.
An IPv4 address contains 32 bits. The number after the slash tells you how many of those bits identify the network portion of the address. In a /24 network, 24 bits identify the network and the remaining 8 bits are available for addresses within that subnet.
Because 8 bits remain in a /24 subnet, there are 256 possible IPv4 addresses. In a traditional subnet, the network address and broadcast address are reserved, leaving 254 addresses normally available for hosts.
A larger CIDR prefix represents a smaller network. For example, a /26 subnet contains 64 total addresses, while a /28 contains 16. A smaller prefix, such as /16, represents a much larger IP address range.
Simple CIDR example
For the address 192.168.1.10/24, the /24 prefix corresponds to a subnet mask of 255.255.255.0. The resulting network is 192.168.1.0/24, with addresses ranging from 192.168.1.0 through 192.168.1.255.
| CIDR Prefix | Subnet Mask | Total Addresses | Traditional Usable Hosts |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /26 | 255.255.255.192 | 64 | 62 |
| /28 | 255.255.255.240 | 16 | 14 |
| /30 | 255.255.255.252 | 4 | 2 |
Traditional usable-host counts subtract the network and broadcast addresses. /31 and /32 networks are special cases.
How does the subnet calculator work?
An IPv4 address contains 32 binary bits. The CIDR prefix tells the calculator how many of those bits belong to the network portion of the address. The remaining bits form the host portion and determine how many IP addresses can exist within the subnet.
For example, a /24 prefix means that 24 bits are used for the network and 8 bits remain for addresses within the subnet. Eight host bits provide 256 possible IPv4 addresses. In a traditional /24 subnet, the network address and broadcast address are not assigned to ordinary hosts, leaving 254 commonly usable host addresses.
The calculator performs the binary operations required to determine these boundaries and then converts the result back into familiar dotted-decimal IPv4 notation.
How to use this IPv4 subnet calculator
- Enter a valid IPv4 address, such as 192.168.1.10.
- Select the required CIDR prefix, such as /24, /26, /28 or /30.
- Click Calculate Subnet.
- Review the calculated network address, broadcast address, subnet mask, wildcard mask and CIDR network.
- Use the first host, last host and usable host count when planning IP address assignments.
Understanding the subnet calculation results
Network address
The network address identifies the subnet itself. It is the first address in the calculated IPv4 range and is normally not assigned to an individual device on a traditional subnet.
Broadcast address
The broadcast address is normally the last IPv4 address in the subnet. It traditionally allows traffic to be addressed to all hosts on that subnet.
Subnet mask
The subnet mask indicates which bits of an IPv4 address belong to the network and which bits belong to hosts. For example, the CIDR prefix /24 corresponds to the subnet mask 255.255.255.0.
Wildcard mask
The wildcard mask is the inverse of the subnet mask. Wildcard masks are commonly encountered in network configuration tasks such as access control lists and routing policies.
CIDR network
CIDR notation expresses the network address and prefix together. A network written as 192.168.1.0/24 therefore identifies both the IPv4 network and its prefix length.
First and last usable host
For traditional IPv4 subnets, usable host addresses normally start one address after the network address and end one address before the broadcast address. /31 and /32 networks have special addressing behavior.
Total addresses
The total address count includes every IPv4 address within the subnet, including addresses that may be reserved as the network and broadcast addresses.
Usable hosts
The usable host count represents the addresses normally available for devices. Traditional subnets usually reserve two addresses, although /31 point-to-point networks and /32 host routes are special cases.
What is CIDR notation?
CIDR stands for Classless Inter-Domain Routing. CIDR notation uses a slash followed by a number to identify the network prefix. Examples include /8, /16, /24 and /30.
The prefix can range from /0 to /32 for IPv4. As the prefix becomes larger, fewer bits remain for addresses inside the subnet, so the subnet becomes smaller. A /24 provides 256 total addresses, whereas a /28 provides 16 total addresses.
IPv4 subnet calculation example
Consider the IPv4 address 192.168.1.10/24. A /24 prefix corresponds to the subnet mask 255.255.255.0. Therefore, the network begins at 192.168.1.0 and ends at 192.168.1.255.
Common IPv4 subnet sizes
The following table provides a quick reference for several commonly used CIDR prefixes and IPv4 subnet masks.
| CIDR | Subnet Mask | Total Addresses | Traditional Usable Hosts |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
Frequently asked questions about subnetting
What does /24 mean?
A /24 prefix means that the first 24 bits of the IPv4 address identify the network portion. It corresponds to the subnet mask 255.255.255.0 and provides 256 total IPv4 addresses.
How many usable hosts are in a /24 subnet?
A traditional /24 IPv4 subnet contains 256 total addresses and normally provides 254 usable host addresses after reserving the network and broadcast addresses.
What is the difference between CIDR and a subnet mask?
CIDR notation and subnet masks describe the same network boundary in different formats. For example, /24 and 255.255.255.0 represent the same prefix length.
What is the difference between an IP address and a network address?
An IP address can identify an individual interface or host, while the network address identifies the subnet that contains a range of IP addresses.
Can I calculate private IP address ranges?
Yes. The calculator works with valid IPv4 addresses, including commonly used private ranges such as 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.
What happens with /31 and /32 networks?
A /31 contains two addresses and is commonly used for point-to-point links under modern networking rules. A /32 represents a single IPv4 address, often used as a host route.