Subnet Calculator
Enter an IPv4 address and a CIDR prefix or netmask to get the network, broadcast, host range, usable count and full binary breakdown - all live.
The highlighted bits are the network portion (the prefix); the rest identify the host.
CIDR notation explained
An IPv4 address is 32 bits. A subnet mask splits those bits into a network part (the leading 1 bits) and a host part (the trailing 0 bits). CIDR notation just counts the network bits: /24 means the first 24 bits are network, leaving 8 for hosts. Those 8 host bits give 256 total addresses, of which the first (network) and last (broadcast) are reserved, so 254 are usable. Change the prefix above and every value updates live, including the binary view that shows exactly where the split falls.
The /31 and /32 special cases
The "reserve two addresses" rule breaks down at the small end. A /31 has only two addresses; reserving both would leave nothing, so RFC 3021 makes both usable for point-to-point links, with no broadcast. A /32 is a single host - network and host collapse into one address, used for loopbacks and single-machine firewall rules. This calculator applies both rules, so a /31 reports 2 usable hosts and a /32 reports 1.
Common subnet sizes
| Prefix | Netmask | Total | 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 |
| /30 | 255.255.255.252 | 4 | 2 |
Working with addresses in other bases? The binary converter turns each octet into bits by hand, and what is my IP shows your own public address to test against these ranges.