One address, one prefix — the whole block follows
An IPv4 address on its own says where a device is; the prefix length — the /24 in 192.168.1.10/24 — says how big the neighbourhood around it is. The first 24 bits name the network and the remaining 8 bits name devices inside it, and from those two facts every other figure on this page is forced: the subnet mask, the first and last addresses of the block, which addresses are reserved, and how many hosts fit. Network engineers do this arithmetic daily — sizing an office LAN, checking whether two devices share a subnet, carving a block into smaller pieces — and do most of it from the one formula below. This calculator runs that formula for any address and any prefix from /0 to /32, on your own device, the way the unit converter handles its factors: stated in the open, checkable by hand.
The formulas, with every term defined
Host bits = 32 − prefix · Total addresses = 2 ^ host bitsSubnet mask = the prefix bits set to 1, the host bits set to 0 · Wildcard mask = the mask flipped, bit for bitNetwork address = the address with every host bit set to 0 · Broadcast address = the network address with every host bit set to 1Usable hosts = total − 2 (for prefixes /0 to /30) · Usable range = network + 1 to broadcast − 1
Read it in words. An IPv4 address is 32 bits; the prefix spends the first part of them naming the network, and the host bits left over are what can vary inside it — so the block size is 2 raised to the host bits, doubling with every host bit added. The mask is that split written as an address: ones over the network part, zeros over the host part. The network address is the block's floor (host bits all zero) and the broadcast address its ceiling (host bits all one), and those two are reserved — the floor names the network itself, the ceiling addresses every device at once — which is why ordinary subnets lose exactly two addresses, and the usable range is everything strictly between them. Two prefixes break that pattern honestly, and the result table says when they do: a /31 point-to-point link uses both of its addresses under RFC 3021, and a /32 is a route to a single host.
Worked example: 192.168.1.10 in a /24
The defaults above enter 192.168.1.10 with prefix /24. Host bits: 32 − 24 = 8, so the block holds 2^8 = 256 addresses. The mask is 24 ones then 8 zeros: 255.255.255.0, and the wildcard flips it to 0.0.0.255. Zeroing the host bits of the entered address gives the network address 192.168.1.0; setting them all to one gives the broadcast 192.168.1.255. The usable hosts are 256 − 2 = 254, running from 192.168.1.1 to 192.168.1.254 — the entered .10 is an ordinary citizen of that range, which is the usual home and small-office layout: one router at .1, say, and 253 further addresses to hand out.
The same address, cut smaller — and two bigger blocks
| Address / prefix | Mask | Network → Broadcast | Total / Usable |
|---|---|---|---|
| 192.168.1.10/24 (worked example) | 255.255.255.0 | 192.168.1.0 → 192.168.1.255 | 256 / 254 |
| 192.168.1.10/25 | 255.255.255.128 | 192.168.1.0 → 192.168.1.127 | 128 / 126 |
| 192.168.1.10/26 | 255.255.255.192 | 192.168.1.0 → 192.168.1.63 | 64 / 62 |
| 192.168.1.10/28 | 255.255.255.240 | 192.168.1.0 → 192.168.1.15 | 16 / 14 |
| 192.168.1.10/30 | 255.255.255.252 | 192.168.1.8 → 192.168.1.11 | 4 / 2 |
| 172.16.35.123/20 | 255.255.240.0 | 172.16.32.0 → 172.16.47.255 | 4,096 / 4,094 |
| 10.0.5.23/16 | 255.255.0.0 | 10.0.0.0 → 10.0.255.255 | 65,536 / 65,534 |
The /30 row is the one that surprises people: 192.168.1.10/30 does not live in a block starting at .0. With only 2 host bits the blocks are 4 addresses wide and tile the range as .0–.3, .4–.7, .8–.11 — so the network address is .8 and .10 is the block's second (and last) usable host, not its middle. The chart near the top makes the same point about size: every step from /24 towards /30 gives up one host bit and halves the block — 256, 64, 16, 4 in the bars for /24, /26, /28 and /30.
Reading a result honestly — the limits
Three cautions belong with any subnet figure. The arithmetic is exact; the plan is yours. This page tells you the block an address and prefix define — whether that block suits your network (gateway placement, DHCP ranges, rooms or VLANs per block) is a design judgement the numbers inform but cannot make. Reserved uses eat into usable space in real networks: a gateway conventionally takes the first usable address, and DHCP pools, static devices and network gear all draw from the same 254. IPv6 is a different world: its addresses are 128 bits, a typical subnet is a /64 holding more addresses than IPv4 has in total, and this calculator deliberately answers IPv4 only rather than stretch one formula across both. And a small confession the page is built on: whether the address you typed is even yours to use — a public block versus the private ranges 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 — matters on a real network, but changes none of the arithmetic above.
Frequently asked questions
How many usable hosts are in a /24?
254. A /24 leaves 8 host bits, so the block holds 2^8 = 256 addresses; the first (192.168.1.0, the network address) and the last (192.168.1.255, the broadcast address) are reserved, leaving 254 addresses for devices, from .1 to .254.
What subnet mask is a /26?
255.255.255.192. The mask is 26 ones followed by 6 zeros; the last octet is 11111100 in binary at the split, which is 192. A /26 holds 64 addresses, 62 of them usable — the worked table above shows 192.168.1.10/26 resolving to the block 192.168.1.0 to 192.168.1.63.
What is the difference between the network and broadcast addresses?
They are the two ends of the block. The network address has every host bit set to 0 and names the subnet itself — routers use it in routing tables. The broadcast address has every host bit set to 1 and reaches all devices in the subnet at once. Neither is given to an individual host in a normal subnet, which is why usable hosts are the total minus two.
What does a /32 mean?
A single address. With a /32 prefix all 32 bits name the network and zero bits remain for hosts, so the block holds exactly one address — the one entered — which is both its network address and its only usable host. Routers use /32 entries as host routes: directions to one specific machine.
Does this calculator work for IPv6?
No — it is IPv4 only, and says so rather than produce a plausible-looking wrong answer. IPv6 addresses are 128 bits instead of 32, are written in hexadecimal groups separated by colons, and are subnetted by different conventions (a standard LAN is a /64). The prefix arithmetic on this page — 32 minus the prefix, two reserved addresses — is IPv4 arithmetic.
