192.168.1.10/24 — a typical home or small-office subnet
Network 192.168.1.0, broadcast 192.168.1.255, usable hosts 192.168.1.1 to 192.168.1.254 (254 addresses).
Result
Fill in the fields to see your result.
A CIDR prefix like /24 means the first 24 bits of the address identify the network, and the remaining bits identify hosts within it. The subnet mask is simply that many 1-bits followed by 0-bits; ANDing an address with the mask zeroes out the host bits, giving the network address.
The broadcast address is the highest address in the block — the network address with every host bit set to 1. Every address strictly between the network and broadcast addresses is assignable to a host, except for two special cases: a /31 (two addresses, both usable, no broadcast — RFC 3021) and a /32 (a single host address).
IPv6 uses the same prefix-length logic but on 128-bit addresses instead of 32-bit ones, so the numbers involved are vastly larger — a single /64, the most common LAN prefix, already contains 2⁶⁴ addresses.
mask = (2^32 − 1) << (32 − prefix) [IPv4]
network = address AND mask; broadcast = network OR (NOT mask)
Network 192.168.1.0, broadcast 192.168.1.255, usable hosts 192.168.1.1 to 192.168.1.254 (254 addresses).
Network 10.0.5.128, broadcast 10.0.5.191, 62 usable host addresses.
A /24 has 2⁸ = 256 total addresses in the block, but the lowest (the network address) and the highest (the broadcast address) are reserved for identifying the subnet itself and sending to everyone on it, leaving 254 assignable to individual hosts.
It is the bitwise inverse of the subnet mask, and some equipment (notably Cisco access-control lists and OSPF configuration) specifies address ranges using the wildcard mask instead of the subnet mask directly.
Updated