Finding the last address in an IPv4 block
On an IPv4 subnet, one address is reserved for sending a packet to every host in the block at once. Technicians look it up when configuring DHCP scopes, writing access lists, reading routing tables and checking why a device cannot reach its neighbors. You enter any address that lies in the subnet and the prefix length, and the page returns that broadcast address. The default of 10.20.30.40 with a prefix of 16 gives 10.20.255.255. The address you type does not have to be the network address or the broadcast address itself; any address in the block leads to the same answer when the prefix is the same.
How the bits work
An IPv4 address is 32 bits, and the prefix says how many leading bits identify the network. The remaining bits identify hosts. The calculator keeps the network bits, which gives the network address, then fills every host bit with 1, which gives the broadcast. Written as a formula, broadcast = network OR inverse mask. For 10.20.30.40/16, the first 16 bits are 10.20 and the last 16 become all ones, 255.255, so the result is 10.20.255.255. The inverse mask is also called the wildcard mask, the form used in some router access lists. A prefix of /16 has a mask of 255.255.0.0 and a wildcard of 0.0.255.255.
Subnets that do not end on an octet
Most real subnets cut through the middle of an octet. For 192.168.1.130/26, the mask is 255.255.255.192, so blocks are 64 addresses long and start at 0, 64, 128 and 192. The address .130 lies in the block starting at .128, which runs to .191, so the broadcast is 192.168.1.191. For 172.16.5.9/20, blocks are 16 wide in the third octet, 5 falls in the block that starts at 0, and the broadcast is 172.16.15.255. A small block such as 203.0.113.77/29 has 8 addresses, 77 falls between 72 and 79, and the broadcast is 203.0.113.79. Block size is 256 minus the mask value in the interesting octet.
What the broadcast is used for
A packet sent to the subnet broadcast is delivered to every interface on that network, and classic protocols such as ARP requests and early DHCP discovery depend on this reach. Broadcasts have a cost, because every host must process them, which is one reason large flat networks are split into smaller subnets. Routers do not forward subnet broadcasts to other networks by default, and RFC 2644 changed the recommended router default so that directed broadcasts, sent from outside to a remote subnet's broadcast address, are not forwarded. That limits abuse such as amplified ping floods. A separate limited broadcast, 255.255.255.255, reaches only the local link and is distinct from any subnet broadcast.
Prefixes the page rejects
The calculator accepts prefixes from 0 to 30 and rejects /31 and /32. A /32 is a single address, so there is no block in which a broadcast could be defined. A /31 holds two addresses; RFC 3021 lets both be used as hosts on a point-to-point link, so neither is a conventional broadcast. For every prefix from /0 through /30, the broadcast exists as the highest address in the block. At the other extreme, a /0 covers the whole IPv4 space, and its broadcast is 255.255.255.255. Typing a prefix outside the range will return an error, not a guess, so check the value if you see one.
Relationship to the usable range
In a conventional subnet of 2^(32−prefix) addresses, the first is the network address and the last is the broadcast. Hosts take the addresses between them, giving total minus two usable addresses. For 198.51.100.5/30 the block has four addresses, 198.51.100.4 to .7. The network is .4, the broadcast is .7, and only .5 and .6 can be hosts, which suits a link between two routers. A /24 block gives 254 hosts, and a /26 gives 62. Knowing the broadcast tells you the upper limit of the host range when you configure a static pool or exclude reserved addresses.
Common mistakes and mask mismatches
The most frequent error is to read the broadcast address as the last address printed in a range without checking the prefix. The same IP address has a different broadcast under /24 and /26, so store the prefix next to every address you record. Another is assuming that .255 is always the broadcast. It is only so when the subnet ends at an octet boundary. With 10.1.2.3/8 the broadcast is 10.255.255.255, but with 192.168.1.64/26 it is 192.168.1.127. Also avoid assigning the broadcast address to a host, because that interface would appear to answer for every device on the link and cause confusing failures. The broadcast address is also a quick way to confirm that two hosts agree on their subnet. If one host believes it is 192.168.1.130/26 and another believes it is 192.168.1.130/24, their broadcasts are 192.168.1.191 and 192.168.1.255, and they will disagree about which neighbors are local. The host with the longer prefix treats addresses beyond .191 as remote and sends that traffic to its gateway instead of resolving it directly. Comparing the broadcast each side computes exposes a mask mismatch faster than reading raw configuration.
Where the convention comes from
The scheme of variable prefix lengths is classless inter-domain routing, specified in RFC 4632, which replaced the older class A, B and C boundaries. Under the older classful model the boundary was implied by the first bits of the address, so 10.x.x.x was always a /8. CIDR attached the prefix length explicitly so that blocks of any power-of-two size could be assigned and aggregated. The rule that the host part set to all ones is the broadcast predates CIDR and survives unchanged. IPv6 has no broadcast address at all and uses multicast groups for the same jobs, which is why this page covers IPv4 only.
What a broadcast address cannot confirm
The result describes the address block only. It does not tell you whether a device is present, whether a router forwards broadcasts, or whether the block is routable on the public internet. The input address must be a valid dotted-decimal IPv4 address. The calculator reports the conventional broadcast, and some equipment, such as point-to-point links or special-purpose blocks, behaves differently. Confirm the design against your network plan, because the prefix is part of the definition, not an optional extra.