tip
~/geeksubnet/masks/24

/24 subnet mask: 255.255.255.0

Every value on this page is reproducible in the calculator.

The /24 prefix means the first 24 bits of the address identify the network and the remaining 8 identify the host. Written out, the mask is 255.255.255.0, in binary 11111111.11111111.11111111.00000000, and its Cisco wildcard or inverse form is 0.0.0.255. It covers 256 addresses, of which 254 can be given to hosts.

/24 at a glance

CIDR prefix/24
Subnet mask255.255.255.0
Mask in binary11111111.11111111.11111111.00000000
Wildcard (inverse) mask0.0.0.255
Host bits8
Total addresses256
Usable hosts254
Block size (magic number)whole octet 3

Every /24 inside 172.16.0.0/16

A 172.16.0.0/16 contains 256 subnets of /24. Here are the first 8, which is enough to see the pattern: each one starts 256 after the last in octet 3.

NetworkFirst hostLast hostBroadcast
172.16.0.0/24172.16.0.1172.16.0.254172.16.0.255
172.16.1.0/24172.16.1.1172.16.1.254172.16.1.255
172.16.2.0/24172.16.2.1172.16.2.254172.16.2.255
172.16.3.0/24172.16.3.1172.16.3.254172.16.3.255
172.16.4.0/24172.16.4.1172.16.4.254172.16.4.255
172.16.5.0/24172.16.5.1172.16.5.254172.16.5.255
172.16.6.0/24172.16.6.1172.16.6.254172.16.6.255
172.16.7.0/24172.16.7.1172.16.7.254172.16.7.255

The magic number for /24

A /24 falls exactly on an octet boundary, so there is no magic number to work out: octet 3 of the mask is 255 and every subnet starts where the previous one ended, counting octet 3 up by one.

Where a /24 shows up in practice

The /24 is the mental unit of IPv4. 254 usable addresses, one subnet per VLAN, the third octet as the subnet number and the fourth as the host. Most people who say "a subnet" mean a /24 without thinking about it.

Frequently asked questions

How many hosts are in a /24?

A /24 holds 256 addresses in total. After reserving the network and broadcast addresses, 254 are usable by hosts.

What is the subnet mask for /24?

The /24 subnet mask is 255.255.255.0 in dotted-decimal notation.

What is the wildcard mask for /24?

The wildcard mask, also called the inverse mask, is 0.0.0.255. It is the bitwise inverse of 255.255.255.0 and is what Cisco access lists and OSPF network statements expect.

What is /24 in binary?

The /24 mask written out bit by bit is 11111111.11111111.11111111.00000000: 24 ones followed by 8 zeros.

Neighbouring masks: /23 is one bit shorter and holds twice as many addresses. /25 is one bit longer and holds half as many.
full cheat sheet subnetting basics open the calculator