Subnet Calculator
Enter an IP address and CIDR prefix length to calculate the full subnet details. Supports both combined notation (192.168.1.0/24) and separate fields.
How to Use the Subnet Calculator
Subnetting is an essential skill for network engineers, system administrators, and anyone managing IP networks. This free online subnet calculator takes an IP address and CIDR prefix length and instantly computes all the details you need to plan and troubleshoot your network. Enter your IP address in one of two ways and click Calculate.
- Combined notation: Type the IP address with the prefix directly in the IP field, for example
10.0.0.0/16. The calculator automatically reads the prefix from the address and overrides the separate CIDR field. - Separate fields: Enter the IP address in the first field and the prefix length (0–32) in the second field. This is convenient when you want to quickly test different prefix lengths on the same address.
- Review results: The calculator shows the network address, broadcast address, first and last usable hosts, total usable hosts, subnet mask, wildcard mask, binary subnet mask, and IP class.
CIDR Prefix Quick Reference
| CIDR | Subnet Mask | Usable Hosts | Total Addresses |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 | 16,777,216 |
| /16 | 255.255.0.0 | 65,534 | 65,536 |
| /24 | 255.255.255.0 | 254 | 256 |
| /25 | 255.255.255.128 | 126 | 128 |
| /28 | 255.255.255.240 | 14 | 16 |
| /30 | 255.255.255.252 | 2 | 4 |
| /31 | 255.255.255.254 | 2 | 2 |
| /32 | 255.255.255.255 | 1 | 1 |
IP Address Classes
- Class A (1.0.0.0 – 126.255.255.255): The first octet identifies the network. Designed for very large organisations with up to 16 million hosts per network.
- Class B (128.0.0.0 – 191.255.255.255): The first two octets identify the network. Used by medium to large organisations with up to 65,534 hosts.
- Class C (192.0.0.0 – 223.255.255.255): The first three octets identify the network. Common for small networks with up to 254 hosts.
- Class D (224.0.0.0 – 239.255.255.255): Reserved for multicast groups. Not used for standard host addressing.
- Class E (240.0.0.0 – 255.255.255.255): Reserved for experimental and future use.
Key Subnetting Concepts
The subnet mask divides an IP address into the network portion and the host portion. All bits set to 1 represent the network, and bits set to 0 represent hosts. The wildcard mask is the bitwise inverse of the subnet mask and is used in Cisco ACLs and OSPF configurations to match address ranges. The network address is the first address in the subnet (all host bits set to 0), and the broadcast address is the last address (all host bits set to 1). Everything between these two is usable for host assignment, except in /31 (point-to-point) and /32 (single host) subnets where the standard rules differ.
Frequently Asked Questions
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation combines an IP address with a prefix length separated by a slash, for example 192.168.1.0/24. The prefix length (0–32) indicates how many leading bits of the address represent the network portion. A /24 prefix means the first 24 bits are the network address and the remaining 8 bits identify individual hosts, giving 254 usable addresses.
How do I calculate usable hosts?
The total number of addresses in a subnet is 2^(32 − prefix). Subtract 2 from that total — one for the network address and one for the broadcast address — to get the usable host count. For example, a /24 subnet has 2^8 = 256 addresses, minus 2 = 254 usable hosts. Special cases: /31 subnets have 2 usable addresses (point-to-point links), and /32 subnets represent a single host.
What is a wildcard mask?
A wildcard mask is the bitwise inverse of the subnet mask. Where the subnet mask has 1s, the wildcard mask has 0s, and vice versa. For example, a subnet mask of 255.255.255.0 has a wildcard mask of 0.0.0.255. Wildcard masks are commonly used in Cisco router access control lists (ACLs) and OSPF network statements to match ranges of IP addresses.