About the subnet calculator
A prefix length p keeps the first p bits of an address as the network and leaves the rest to number hosts. The calculator ANDs the address with the netmask to find the network address, ORs that with the wildcard mask (the inverted netmask) to find the last address, and counts 2^(32 − p) addresses for IPv4 or 2^(128 − p) for IPv6.
Engineers use it to plan VLANs, firewall rules and cloud VPC ranges. The default, 192.168.10.77/26, belongs to 192.168.10.64/26: 64 addresses, 62 of them usable from .65 to .126, with .127 as the broadcast. Splitting it 4 ways gives four /28 subnets of 16 addresses.
IPv4 counts leave out the network and broadcast addresses except on /31 point-to-point links (RFC 3021) and /32 host routes. IPv6 has no broadcast, so only the subnet-router anycast address is left out. Splits are always into a power of two equal subnets; for a VLSM plan, split one of the results again.
Questions
How many usable hosts are in a /24 subnet?
A /24 has 256 addresses and 254 usable hosts, because the all-zeros address names the network and the all-ones address is the broadcast. The IPv4 rule is 2^(32 − prefix) − 2: a /25 gives 126, a /26 62, a /27 30, a /28 14, a /29 6 and a /30 2. The exceptions are /31, where RFC 3021 lets a point-to-point link use both addresses, and /32, a single host.
What is the difference between a subnet mask and CIDR notation?
They say the same thing in two ways. CIDR notation writes the number of network bits after a slash, as in /26; a subnet mask writes those bits as a dotted address with that many leading ones, so /26 is 255.255.255.192 and /20 is 255.255.240.0. CIDR, introduced in 1993 and now defined in RFC 4632, replaced the fixed class A, B and C boundaries, so any prefix from /0 to /32 is valid.
What is a wildcard mask?
A wildcard mask is the subnet mask with every bit inverted, so 255.255.255.192 becomes 0.0.0.63. Cisco IOS access lists and OSPF network statements use it: a 0 bit must match and a 1 bit is ignored. To get it, subtract each octet of the netmask from 255. For a /26 the last octet is 63, one less than the block's 64 addresses.
Why do AWS and Azure subnets have 5 fewer usable addresses?
Both clouds reserve 5 addresses in every subnet: the network address, the next three (for the router and DNS, or held for future use) and the last address. A /24 in an AWS VPC or Azure virtual network therefore has 251 assignable addresses instead of the 254 shown here. The smallest subnet AWS allows is a /28, which leaves 11; Azure's smallest is a /29, which leaves 3.
How many addresses are in an IPv6 /64?
A /64 holds 2^64 = 18,446,744,073,709,551,616 addresses. It is the standard size for one IPv6 LAN because RFC 4291 requires 64-bit interface identifiers for most unicast addresses, and stateless autoconfiguration (SLAAC) builds addresses from them. A /48 contains 65,536 of those /64 subnets, and a /56 contains 256.
How accurate is the subnet calculator?
Accuracy depends on your inputs and the method's assumptions. Decimal arithmetic uses 50 significant digits, but estimates, numerical methods and source data can be less precise; the displayed rounding does not remove those limits. It is checked against 7 worked examples whose answers come from independent sources; for example, “Host in a /26” is checked against Python 3.8 ipaddress.ip_interface('192.168.10.77/26').network, .netmask, .hostmask, .broadcast_address, list(hosts()).
Where does the method come from?
RFC 4632 — Classless Inter-domain Routing (CIDR); RFC 3021 — Using 31-bit prefixes on IPv4 point-to-point links; RFC 1918 — Address allocation for private internets; RFC 4291 — IPv6 addressing architecture; RFC 5952 — IPv6 text representation; IANA IPv4 and IPv6 special-purpose address registries (RFC 6890).