IPv4 Subnet Masks, CIDR Notation, and Host Counts

Subnet Masks

ClassSubnet MaskBinary Subnet Mask
A255.0.0.0 11111111.00000000.00000000.00000000
B 255.255.0.0 11111111.11111111.00000000.00000000
C 255.255.255.0 11111111.11111111.11111111.00000000
Ones (1's) are network bits.
Zeros (0's) are node bits (assignable address bits).

IPv4 Address Counts by Class

ClassTotal Addresses
A16,777,216 (2^24)
B65,536 (2^16)
C256 (2^8)

These are total addresses in each class range; usable host counts exclude the network and broadcast addresses.

CIDR Subnet Mask and Usable Host Reference

BitsSubnet MaskSubnets Within a /8 NetworkUsable Hosts
8255.0.0.0116,777,214
16255.255.0.025665,534
24255.255.255.0 65,536254
25255.255.255.128131,072126
26255.255.255.192262,14462
27255.255.255.224524,28830
28255.255.255.2401,048,57614
29255.255.255.2482,097,1526
30255.255.255.2524,194,3042

Subnet counts use a class A /8 network as the reference. Usable host counts exclude the network and broadcast addresses.

Binary Subnet Representation

DecimalBinaryBits
.128 100000001
.192110000002
.224111000003
.240111100004
.248 111110005
.252111111006
.254111111107
.255111111118