What Is a Subnet? Subnetting and CIDR Explained

A subnet is a slice of an IP network that you can route on its own. This guide explains what the subnet mask actually does, how to read CIDR notation such as /24, how many hosts fit in a prefix, and how to find the network and broadcast address without guessing.

Direct answer

A subnet is a logical division of an IP network โ€” a group of addresses that share the same network prefix and can reach each other directly, without going through a router. The prefix length in CIDR notation tells you how big that group is: 192.168.10.0/24 holds 256 addresses, of which 254 can be assigned to devices. Subnetting is the practice of splitting one large network into smaller ones, and the subnet mask is the number that defines where the split falls.

What a subnet actually is

An IPv4 address is 32 bits long, and it is always read as two parts: a network part and a host part. Which bits are which is not fixed โ€” the subnet mask decides. In 192.168.10.42/24 the first 24 bits (192.168.10) name the network and the last 8 bits (42) name the device.

That split changes how traffic moves. When your computer wants to reach another address, it compares its own prefix with the destination prefix:

This is why a wrong subnet mask is such a common outage: a device with the wrong prefix believes a destination is local, sends the packet onto the wire, and nobody answers. The address looks fine, the cable is fine, but nothing routes.

The subnet mask: where the split falls

A subnet mask is a 32-bit number written in the same dotted form as an IP address. It is always a run of 1s followed by a run of 0s, and the boundary between the two is the boundary between network and host:

MaskBinaryMeans
255.255.255.011111111.11111111.11111111.0000000024 network bits, 8 host bits = /24
255.255.0.011111111.11111111.00000000.0000000016 network bits, 16 host bits = /16

Count the 1s and you have the prefix length. That is the whole relationship between a mask and CIDR: 255.255.255.192 has 26 ones, so it is a /26. Devices do not actually need CIDR to work โ€” they need the mask โ€” but nobody wants to write out 255.255.255.192 when /26 says the same thing in three characters.

CIDR notation: what /24, /26 and /30 mean

Every prefix fixes how many addresses fall inside it, because the remaining bits are the host space. Two of those addresses are reserved in every normal subnet: the network address (all host bits 0) and the broadcast address (all host bits 1). That is why a /24 with 256 addresses has 254 usable hosts.

PrefixSubnet maskAddressesUsable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/30255.255.255.25242
/31255.255.255.25420 (2 on point-to-point links)
/32255.255.255.25511 (single host)

The jump from /30 to /31 looks odd because /31 breaks the rule on purpose: it has no room for both reserved addresses, so RFC 3021 allows both of its two addresses to be used on point-to-point links between routers. A /32 is a single host, used for loopback addresses and host routes.

If you want the bit-level arithmetic done for you โ€” network, broadcast, first and last usable host, wildcard mask โ€” the Subnet Calculator returns all of it for any address and prefix.

Splitting a /24 into four /26 subnets

The block size is the trick that makes subnetting mental arithmetic possible: 256 minus the mask octet. For 255.255.255.192 that is 256 โˆ’ 192 = 64, so the subnets inside 192.168.10.0/24 start every 64 addresses:

192.168.10.0/24 256 addresses ยท 254 usable hosts .0/26 hosts .1 โ€“ .62 bcast .63 .64/26 hosts .65 โ€“ .126 bcast .127 .128/26 hosts .129 โ€“ .190 bcast .191 .192/26 hosts .193 โ€“ .254 bcast .255 Four subnets of 64 addresses each ยท block size = 256 โˆ’ 192 = 64
One /24 network split into four /26 subnets, each with 62 usable host addresses

Read the second subnet out loud and it becomes a sentence: network 192.168.10.64, usable range .65 to .126, broadcast .127.

Why subnetting exists

Subnetting is not a formality you satisfy for an exam โ€” it solves real problems that appear as soon as a network grows past a handful of devices:

Private ranges make this visible at home: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are reserved for local networks, and every router splits the piece it was given into subnets. You can read more in What Is an IP Address?

Numbers that trip people up

A few mistakes account for most subnetting confusion:

To check what a specific range contains, the network calculator and the broadcast address calculator cover the cases a prefix table cannot.

Subnets in IPv6

IPv6 has no subnet mask and no broadcast address. The prefix length works the same way, but a single number is the practical standard: /64 for every local network. A /64 holds 264 addresses โ€” more than enough for any building โ€” and a /64 is what Stateless Address Autoconfiguration and most provider allocations assume.

In practice an ISP hands a site a /56 or /48, and you carve that into /64s per VLAN. A /48 contains 65,536 /64 networks, so address shortage stops being the constraint and planning does the work instead. You can split and verify IPv6 prefixes with the IPv6 subnet calculator; the background is in IPv4 vs IPv6.

Calculate any subnet in one step

Enter an IPv4 address and a prefix โ€” get the network, broadcast, usable range, wildcard mask and host count.

Open the Subnet Calculator โ†’

Frequently asked questions

What is a subnet in simple terms?

A subnet is a smaller, logically separated part of a larger IP network. All devices in the same subnet share the same network prefix, so they can send traffic to each other directly instead of through a router. For example, 192.168.10.0/24 is one subnet with 254 usable addresses.

What does /24 mean in an IP address?

The /24 is the prefix length in CIDR notation: it says that the first 24 of the 32 bits belong to the network and the remaining 8 bits identify hosts. That leaves 256 addresses, of which the first (network address) and the last (broadcast address) cannot be assigned, so a /24 has 254 usable host addresses.

What is the difference between a subnet mask and CIDR notation?

They describe the same thing in two ways. A subnet mask writes the 24 network bits as 255.255.255.0, while CIDR notation writes the same thing as /24. The mask is what a device compares bit by bit to decide whether a destination is local; CIDR is the shorthand people write down.

How many usable hosts are in a /26?

A /26 contains 64 addresses. Subtracting the network address and the broadcast address leaves 62 usable host addresses. The block size is 64, so the /26 subnets inside a /24 start at .0, .64, .128 and .192.

What is a broadcast address?

The broadcast address is the last address in a subnet, where all host bits are set to 1. Traffic sent there reaches every device in that subnet. In 192.168.10.64/26 the broadcast address is 192.168.10.127, and it cannot be assigned to a computer.

Can I use a /31 or /32 subnet?

Yes, with a caveat. A /31 has two addresses and no network or broadcast address, so both can be used on point-to-point links (RFC 3021). A /32 is a single address, used for host routes and loopback addresses.

How do I calculate a subnet quickly?

Work from the block size: 256 minus the value of the mask octet. For 255.255.255.192 that is 64, so the subnets step 64 addresses at a time. The Subnet Calculator on IPChecks shows the network, broadcast, usable range and prefix for any IPv4 address, and there is a separate IPv6 subnet calculator.

Cookie preferences