numvana

IPv4 Subnet Mask / CIDR Calculator

Enter an IPv4 address and a CIDR prefix length to get its subnet mask, network and broadcast addresses, usable host range, and host count.

IP address
192.168.1.10
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Network address
192.168.1.0
Broadcast address
192.168.1.255
Usable host range
192.168.1.1 - 192.168.1.254
Usable host count
254
Total addresses in subnet
256

How it works

A CIDR prefix like /24 says how many of the address's 32 bits are the fixed 'network' portion — the rest are 'host' bits, free to vary within that subnet. The subnet mask is just those network bits set to 1 and the host bits set to 0 (a /24 is 11111111.11111111.11111111.00000000, i.e. 255.255.255.0).

The network address is the entered IP with every host bit forced to 0 (the IP ANDed with the mask); the broadcast address is the same but with every host bit forced to 1. Every address strictly between them is a usable host address — ordinary hosts can't use the network or broadcast address itself, so a /24's 256 total addresses yield 254 usable ones.

Two sizes get special treatment, per the standard convention: a /32 is a single address with no network/broadcast split (used for host routes), so it counts as 1 usable address; a /31 is the RFC 3021 point-to-point exception, where both addresses in the pair are usable since a two-address subnet has no room left for a separate broadcast address.

FAQ

What's the wildcard mask for?

It's the subnet mask with every bit flipped — Cisco access-control lists and some routing configurations specify it instead of (or alongside) the subnet mask, since it directly marks which bits are allowed to vary. It's shown here since it's a direct bitwise complement of the mask, not an extra lookup.

Why does a /31 show 2 usable hosts when every other small prefix reserves 2 addresses?

Because RFC 3021 specifically carves out that exception for point-to-point links (like a connection between two routers), where reserving a broadcast address would waste half the already-tiny 2-address subnet for no benefit — both addresses are treated as usable host addresses instead.

Related calculators