Subnet Masks and CIDR Notation Explained
Developer · October 9, 2026 · 1 min read
An IPv4 address like 192.168.1.10 is really a 32-bit number written as four bytes. A subnet divides that number into two parts: the network (which group of devices) and the host (which device inside the group).
The subnet mask
The mask marks which bits belong to the network. Where the mask has a 1, the bit is part of the network address, and where it has a 0, the bit is for hosts. 255.255.255.0 is 24 ones followed by 8 zeros.
CIDR notation
CIDR writes the mask as a slash and the number of 1 bits. So 255.255.255.0 becomes /24, and 192.168.1.10/24 means "the address 192.168.1.10 on a network whose first 24 bits are the network part".
Counting addresses
A /24 leaves 8 bits for hosts, giving 2⁸ = 256 addresses. The first is the network address and the last is the broadcast address, and neither can be given to a device. So usable hosts are 2^(32 - prefix) - 2, which is 254 for a /24.
/24: 256 addresses, 254 usable (mask 255.255.255.0)./25: 128 addresses, 126 usable (mask 255.255.255.128)./26: 64 addresses, 62 usable (mask 255.255.255.192)./30: 4 addresses, 2 usable, often used for links between two routers./16: 65,536 addresses (mask 255.255.0.0).
Private address ranges
10.0.0.0/8172.16.0.0/12(172.16.0.0 to 172.31.255.255)192.168.0.0/16
These are reserved for private networks such as your home or office. They aren't routed on the public internet.
Splitting a network
To split a network, make the prefix longer. Each extra bit doubles the number of subnets. A /24 split into four becomes four /26 networks:
192.168.1.0/26 hosts .1 - .62 192.168.1.64/26 hosts .65 - .126 192.168.1.128/26 hosts .129 - .190 192.168.1.192/26 hosts .193 - .254
Enter any address and prefix into the IP Subnet Calculator to see the network, broadcast, host range and mask, and to split it into smaller subnets.