// live binary breakdown
IP Subnet Calculator.
Practice and Learn Subnetting.
Type an address, drag the mask — watch exactly which bits belong to the network and which belong to the host, in real time.
Address bits
Address info
What Is a Subnet Mask, and How Does Subnetting Actually Work?
A subnet mask is what splits an IPv4 address into two
parts: the network portion and the host portion. Every
device on a network needs to know where its own network ends and the
rest of the internet begins — the subnet mask is how it figures that
out. When you see an address written as 192.168.1.10 with
a mask of 255.255.255.0, the mask is telling every device
"the first three octets identify the network, the last octet
identifies you."
Subnetting is the process of taking a network and splitting it into smaller pieces. It's how organizations avoid wasting thousands of IP addresses on a department that only has twenty computers, and how routers know whether to deliver a packet locally or send it further along.
CIDR Notation — What the "/24" Means
Instead of writing out a full subnet mask like 255.255.255.0,
it's usually shorter to write it as CIDR notation: a
slash followed by a number, like /24. That number is
simply how many bits, counting from the left, are set to 1 in the
mask. A /24 mask has 24 leading 1-bits, which
converts to 255.255.255.0 — leaving 8 bits (one octet)
for host addresses. The smaller the number after the slash, the
more host bits are left over, and the larger the
network is.
Common Subnet Masks — Quick Reference
| CIDR | Subnet Mask | Total Addresses | Usable Hosts | Typical Use |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | Legacy Class A block |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Large organization |
| /24 | 255.255.255.0 | 256 | 254 | Typical office / home LAN |
| /25 | 255.255.255.128 | 128 | 126 | Splitting a /24 in half |
| /26 | 255.255.255.192 | 64 | 62 | Small department |
| /27 | 255.255.255.224 | 32 | 30 | Small office / VLAN |
| /28 | 255.255.255.240 | 16 | 14 | Server rack / small VLAN |
| /29 | 255.255.255.248 | 8 | 6 | Handful of devices |
| /30 | 255.255.255.252 | 4 | 2 | Router-to-router link |
| /31 | 255.255.255.254 | 2 | 2* | Point-to-point (RFC 3021) |
| /32 | 255.255.255.255 | 1 | 1† | Single host route |
* A /31 has no network or broadcast address reserved — both
addresses are usable, per RFC 3021. † A /32 identifies exactly
one address and is typically used for loopbacks and host routes, not a
real "subnet" with usable hosts.
Worked Example: Subnetting 192.168.10.77/27 by Hand
-
Write out the mask.
/27means 27 leading 1-bits:11111111.11111111.11111111.11100000, which is255.255.255.224. -
Find the block size. There are
32 − 27 = 5host bits left, so each subnet contains2⁵ = 32addresses. Subnets in the last octet start at 0 and repeat every 32: 0, 32, 64, 96, 128… -
Find which block the address falls in. The address
ends in
.77, which falls between.64and the next boundary at.96— so this address belongs to the192.168.10.64/27subnet. -
Network and broadcast. Network address:
192.168.10.64. Broadcast address (one below the next boundary):192.168.10.95. -
Usable range. Everything between network and
broadcast:
192.168.10.65through192.168.10.94— 30 usable host addresses.
Try it yourself with the calculator above — type
192.168.10.77 and drag the prefix to /27 to
see it confirmed instantly, bit by bit.
Frequently Asked Questions
What's the difference between a subnet mask and a wildcard mask?
They're inverses of each other. A subnet mask marks network bits
with 1s and host bits with 0s (e.g. 255.255.255.0). A
wildcard mask flips that — it marks the bits that are allowed to
vary with 1s (e.g. 0.0.0.255). Wildcard masks show up
mainly in Cisco access control lists and OSPF network statements.
Why does a subnet lose two addresses (network and broadcast)?
The very first address in a subnet is reserved to identify the
subnet itself (the network address), and the very last address is
reserved for broadcasting to every host on that subnet (the
broadcast address). Neither can be assigned to a device, which is
why usable hosts is always total addresses minus 2 — except for
/31 and /32, which are special cases.
What is a "usable host" address?
Any address in the subnet's range that can actually be assigned to a device — that is, every address between the network address and the broadcast address, exclusive of both.
How is CIDR different from a "class" (Class A/B/C)?
Classful addressing (Class A/B/C) was the original, rigid way of
allocating networks in fixed sizes based on the first octet. CIDR
(Classless Inter-Domain Routing) replaced that rigidity by letting
the prefix length be anything from /0 to
/32, so networks can be sized to fit what's actually
needed instead of being forced into a fixed class boundary.
Why don't /31 and /32 follow the usual "minus 2" rule?
A /31 only has two addresses total, and reserving both
for network/broadcast would leave zero usable — so RFC 3021 makes
both addresses usable, which is exactly enough for a point-to-point
link between two routers. A /32 has only one address
period, so it's used to identify a single host or interface (like a
loopback), not to hold a range of hosts at all.