// 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.

/24

Address bits

Network Host

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
/8255.0.0.016,777,21616,777,214Legacy Class A block
/16255.255.0.065,53665,534Large organization
/24255.255.255.0256254Typical office / home LAN
/25255.255.255.128128126Splitting a /24 in half
/26255.255.255.1926462Small department
/27255.255.255.2243230Small office / VLAN
/28255.255.255.2401614Server rack / small VLAN
/29255.255.255.24886Handful of devices
/30255.255.255.25242Router-to-router link
/31255.255.255.25422*Point-to-point (RFC 3021)
/32255.255.255.25511†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

  1. Write out the mask. /27 means 27 leading 1-bits: 11111111.11111111.11111111.11100000, which is 255.255.255.224.
  2. Find the block size. There are 32 − 27 = 5 host bits left, so each subnet contains 2⁵ = 32 addresses. Subnets in the last octet start at 0 and repeat every 32: 0, 32, 64, 96, 128…
  3. Find which block the address falls in. The address ends in .77, which falls between .64 and the next boundary at .96 — so this address belongs to the 192.168.10.64/27 subnet.
  4. Network and broadcast. Network address: 192.168.10.64. Broadcast address (one below the next boundary): 192.168.10.95.
  5. Usable range. Everything between network and broadcast: 192.168.10.65 through 192.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.