IPv4 Netmasks Expanded

A subnet calculator, such as http://www.routemeister.net/projects/sipcalc/, is an invaluable tool. Sometimes a quick reference sheet works better. Here are the most common IPv4 subnets expanded:

Netmask         Netmask                                 (binary) CIDR Notes
255.255.255.255 11111111.11111111.11111111.11111111 /32 Host (single address)
255.255.255.254 11111111.11111111.11111111.11111110 /31 Unuseable
255.255.255.252 11111111.11111111.11111111.11111100 /30 2 useable
255.255.255.248 11111111.11111111.11111111.11111000 /29 6 useable
255.255.255.240 11111111.11111111.11111111.11110000 /28 14 useable
255.255.255.224 11111111.11111111.11111111.11100000 /27 30 useable
255.255.255.192 11111111.11111111.11111111.11000000 /26 62 useable
255.255.255.128 11111111.11111111.11111111.10000000 /25 126 useable
255.255.255.0   11111111.11111111.11111111.00000000 /24 "Class C" 254 useable



Netmask 255.255.255.0 /24 (11111111.11111111.11111111.00000000)
1 subnet
LOW IP       HI IP
x.x.x.0      x.x.x.255

Netmask 255.255.255.128 /25 (11111111.11111111.11111111.10000000)
2 subnets
LOW IP       HI IP
x.x.x.0      x.x.x.127
x.x.x.128    x.x.x.255

Netmask 255.255.255.192 /26 (11111111.11111111.11111111.11000000)
4 subnets
x.x.x.0      x.x.x.63
x.x.x.64     x.x.x.127
x.x.x.128    x.x.x.191
x.x.x.192    x.x.x.255

Netmask 255.255.255.224 /27 (11111111.11111111.11111111.11100000)
8 subnets
x.x.x.0      x.x.x.31
x.x.x.32     x.x.x.63
x.x.x.64     x.x.x.95
x.x.x.96     x.x.x.127
x.x.x.128    x.x.x.159
x.x.x.160    x.x.x.191
x.x.x.192    x.x.x.223
x.x.x.224    x.x.x.255

Netmask 255.255.255.240 /28 (11111111.11111111.11111111.11110000)
16 subnets
x.x.x.0      x.x.x.15
x.x.x.16     x.x.x.31
x.x.x.32     x.x.x.47
x.x.x.48     x.x.x.63
x.x.x.64     x.x.x.79
x.x.x.80     x.x.x.95
x.x.x.96     x.x.x.111
x.x.x.112    x.x.x.127
x.x.x.128    x.x.x.143
x.x.x.144    x.x.x.159
x.x.x.160    x.x.x.175
x.x.x.176    x.x.x.191
x.x.x.192    x.x.x.207
x.x.x.208    x.x.x.223
x.x.x.224    x.x.x.239
x.x.x.240    x.x.x.255

Netmask 255.255.255.248 /29 (11111111.11111111.11111111.11111000)
32 subnets
x.x.x.0      x.x.x.7
x.x.x.8      x.x.x.15
x.x.x.16     x.x.x.23
x.x.x.24     x.x.x.31
x.x.x.32     x.x.x.39
x.x.x.40     x.x.x.47
x.x.x.48     x.x.x.55
x.x.x.56     x.x.x.63
x.x.x.64     x.x.x.71
x.x.x.72     x.x.x.79
x.x.x.80     x.x.x.87
x.x.x.88     x.x.x.95
x.x.x.96     x.x.x.103
x.x.x.104    x.x.x.111
x.x.x.112    x.x.x.119
x.x.x.120    x.x.x.127
x.x.x.128    x.x.x.135
x.x.x.136    x.x.x.143
x.x.x.144    x.x.x.151
x.x.x.152    x.x.x.159
x.x.x.160    x.x.x.167
x.x.x.168    x.x.x.175
x.x.x.176    x.x.x.183
x.x.x.184    x.x.x.191
x.x.x.192    x.x.x.199
x.x.x.200    x.x.x.207
x.x.x.208    x.x.x.215
x.x.x.216    x.x.x.223
x.x.x.224    x.x.x.231
x.x.x.232    x.x.x.239
x.x.x.240    x.x.x.247
x.x.x.248    x.x.x.255

Netmask 255.255.255.252 /30 (11111111.11111111.11111111.11111100)
64 subnets
LOW IP       HI IP
x.x.x.0      x.x.x.3
x.x.x.4      x.x.x.7
x.x.x.8      x.x.x.11
x.x.x.12     x.x.x.15
x.x.x.16     x.x.x.19
x.x.x.20     x.x.x.23
x.x.x.24     x.x.x.27
x.x.x.28     x.x.x.31
x.x.x.32     x.x.x.35
x.x.x.36     x.x.x.39
x.x.x.40     x.x.x.43
x.x.x.44     x.x.x.47
x.x.x.48     x.x.x.51
x.x.x.52     x.x.x.55
x.x.x.56     x.x.x.59
x.x.x.60     x.x.x.63
x.x.x.64     x.x.x.67
x.x.x.68     x.x.x.71
x.x.x.72     x.x.x.75
x.x.x.76     x.x.x.79
x.x.x.80     x.x.x.83
x.x.x.84     x.x.x.87
x.x.x.88     x.x.x.91
x.x.x.92     x.x.x.95
x.x.x.96     x.x.x.99
x.x.x.100    x.x.x.103
x.x.x.104    x.x.x.107
x.x.x.108    x.x.x.111
x.x.x.112    x.x.x.115
x.x.x.116    x.x.x.119
x.x.x.120    x.x.x.123
x.x.x.124    x.x.x.127
x.x.x.128    x.x.x.131
x.x.x.132    x.x.x.135
x.x.x.136    x.x.x.139
x.x.x.140    x.x.x.143
x.x.x.144    x.x.x.147
x.x.x.148    x.x.x.151
x.x.x.152    x.x.x.155
x.x.x.156    x.x.x.159
x.x.x.160    x.x.x.163
x.x.x.164    x.x.x.167
x.x.x.168    x.x.x.171
x.x.x.172    x.x.x.175
x.x.x.176    x.x.x.179
x.x.x.180    x.x.x.183
x.x.x.184    x.x.x.187
x.x.x.188    x.x.x.191
x.x.x.192    x.x.x.195
x.x.x.196    x.x.x.199
x.x.x.200    x.x.x.203
x.x.x.204    x.x.x.207
x.x.x.208    x.x.x.211
x.x.x.212    x.x.x.215
x.x.x.216    x.x.x.219
x.x.x.220    x.x.x.223
x.x.x.224    x.x.x.227
x.x.x.228    x.x.x.231
x.x.x.232    x.x.x.235
x.x.x.236    x.x.x.239
x.x.x.240    x.x.x.243
x.x.x.244    x.x.x.247
x.x.x.248    x.x.x.251
x.x.x.252    x.x.x.255

net mask:

1111 11 00 == 252

Pozar's two-bit(tm) addressing

4-bit  m m m m
2-bit  m m
(.1)   0 0 0 0  0 0 0 1           (.2) 0 0 0 0  0 0 1 0
(.17)  0 0 0 1  0 0 0 1          (.18) 0 0 0 1  0 0 1 0
(.33)  0 0 1 0  0 0 0 1          (.34) 0 0 1 0  0 0 1 0
(.49)  0 0 1 1  0 0 0 1          (.50) 0 0 1 1  0 0 1 0
(.65)  0 1 0 0  0 0 0 1          (.66) 0 1 0 0  0 0 1 0
(.129) 1 0 0 0  0 0 0 1         (.130) 1 0 0 0  0 0 1 0
(.193) 1 1 0 0  0 0 0 1         (.194) 1 1 0 0  0 0 1 0
(.225) 1 1 1 0  0 0 0 1         (.226) 1 1 1 0  0 0 1 0



CIDR:  Classless Inter-Domain Routing -- Standard Boundaries

                                        (inverse mask)
Netmask         bits # IPs      # C's   source-wildcard

255.255.255.255 /32  1          <        0.0.0.0
255.255.255.254 /31  2          <        0.0.0.1
255.255.255.252 /30  4          <        0.0.0.3
255.255.255.248 /29  8          <        0.0.0.7
255.255.255.240 /28  16         <        0.0.0.15
255.255.255.224 /27  32         <        0.0.0.31
255.255.255.192 /26  64         <        0.0.0.63
255.255.255.128 /25  128        <        0.0.0.127
255.255.255.0   /24  256        1        0.0.0.255
255.255.254.0   /23  512        2        0.0.1.255
255.255.252.0   /22  1024       4        0.0.3.255
255.255.248.0   /21  2048       8        0.0.7.255
255.255.240.0   /20  4096       16       0.0.15.255
255.255.224.0   /19  8192       32       0.0.31.255
255.255.192.0   /18  16384      64       0.0.63.255
255.255.128.0   /17  32768      128      0.0.127.255
255.255.0.0     /16  65536      256      0.0.255.255
255.254.0.0     /15  131072     512      0.1.255.255
255.252.0.0     /14  262144     1024     0.3.255.255
255.248.0.0     /13  524288     2048     0.7.255.255
255.240.0.0     /12  1048576    4096     0.15.255.255
255.224.0.0     /11  2097152    8192     0.31.255.255
255.192.0.0     /10  4194304    16384    0.63.255.255
255.128.0.0     /9   8388608    32768    0.127.255.255
255.0.0.0       /8   16777216   65536    0.255.255.255
254.0.0.0       /7   33554432   131072   1.255.255.255
252.0.0.0       /6   67108864   262144   3.255.255.255
248.0.0.0       /5   134217.72K 524288   7.255.255.255
240.0.0.0       /4   268435.44K 1048576  15.255.255.255
224.0.0.0       /3   536870.88K 2097152  31.255.255.255
192.0.0.0       /2   1073741.7K 4194304  63.255.255.255
128.0.0.0       /1   2147483.4K 8388608  127.255.255.255
0.0.0.0         /0   4294966.8K 16777216 255.255.255.255

----------

Here's some general rules about how this allocation works.  Keep in mind that
all of these "masks" are really based on binary AND/OR masking, thus a
decimal "255" is binary 11111111 and a decimal "0" is binary "00000000".
Here's a little table in binary which may be of help:

255.255.255.255 /32  11111111.11111111.11111111.11111111
255.255.255.254 /31  11111111.11111111.11111111.11111110
255.255.255.252 /30  11111111.11111111.11111111.11111100
255.255.255.248 /29  11111111.11111111.11111111.11111000
255.255.255.240 /28  11111111.11111111.11111111.11110000
255.255.255.224 /27  11111111.11111111.11111111.11100000
255.255.255.192 /26  11111111.11111111.11111111.11000000
255.255.255.128 /25  11111111.11111111.11111111.10000000
255.255.255.0   /24  11111111.11111111.11111111.00000000
255.255.254.0   /23  11111111.11111111.11111110.00000000
255.255.252.0   /22  11111111.11111111.11111100.00000000
255.255.248.0   /21  11111111.11111111.11111000.00000000
255.255.240.0   /20  11111111.11111111.11110000.00000000
255.255.224.0   /19  11111111.11111111.11100000.00000000
255.255.192.0   /18  11111111.11111111.11000000.00000000
255.255.128.0   /17  11111111.11111111.10000000.00000000
255.255.0.0     /16  11111111.11111111.00000000.00000000
... etc ...

A /32 is an allocation of   1 IP,   and there is 256 /32's in a /24.
A /31 is an allocation of   2 IP's, and there is 128 /31's in a /24.
A /30 is an allocation of   4 IP's, and there is  64 /30's in a /24.
A /29 is an allocation of   8 IP's, and there is  32 /29's in a /24.
A /28 is an allocation of  16 IP's, and there is  16 /28's in a /24.
A /27 is an allocation of  32 IP's, and there is   8 /27's in a /24.
A /26 is an allocation of  64 IP's, and there is   4 /26's in a /24.
A /25 is an allocation of 128 IP's, and there is   2 /25's in a /24.
A /24 is an allocation of 256 IP's, and there is   1 /24   in a /24.

----------

Starting "Network" IP address of Subnetted /24's (last octet value):
        NOTE:  *0 - Zero subnet may not functional on ALL CPE types

/32:    Any IP is an individual /32.
/31:    IP evenly divisible by 2. (e.g. *0,2,4,6,8,10,12,14,16,18 ... 252,254)
/30:    IP evenly divisible by 4. (e.g. *0,4,8,12,16,20,24,28,32, ... 248,252)
/29:    IP evenly divisible by 8. (e.g. *0,8,16,24,32,40,48,56,64, ... 240,248)
/28:    IP evenly divisible by 16. (e.g. *0,16,32,48,64,80,96,112, ... 224,240)
/27:    IP evenly divisible by 32. (e.g. *0,32,64,96,128,160,192,224)
/26:    IP evenly divisible by 64. (e.g. *0,64,128,192)