IPv4 Subnet Calculator — CIDR, mask & host range
Calculate the network and broadcast address, host range, wildcard mask and CIDR notation of any IPv4 block, and split it into equal subnets. Free and instant.
With or without a prefix — 10.0.0.0/8, 192.168.1.0 or 172.16.5.4/255.255.0.0.
Subnet details
| Subnet ID | Subnet address | Host address range | Broadcast address |
|---|---|---|---|
| 1 | 192.168.1.0/24 | 192.168.1.1 – 192.168.1.254 | 192.168.1.255 |
About the Subnet calculator tool
An IPv4 address is thirty-two bits, and a subnet mask says where to cut them. Everything to the left of the cut identifies the network; everything to the right identifies a host inside it. Write 192.168.1.0/24 and you are saying the first twenty-four bits are fixed, leaving eight bits — 256 addresses — for the hosts. That single number is what determines how many machines fit, which addresses are usable, and whether two devices believe they are on the same network at all.
Two addresses in most blocks are not yours to assign. The first, with all host bits zero, is the network address itself, and the last, with all host bits one, is the broadcast address for the segment. That is why a /24 holds 256 addresses but only 254 hosts, and why the usable range in a /24 runs from .1 to .254. Getting this wrong is the classic cause of a device that configures cleanly and then cannot reach anything.
The wildcard mask is the subnet mask inverted, and it exists because Cisco access lists and OSPF network statements are written with it rather than with a mask. A /24 has the mask 255.255.255.0 and the wildcard 0.0.0.255. There is no cleverness to it beyond flipping every bit, but flipping thirty-two bits by hand under pressure is exactly the sort of thing that produces an ACL matching the wrong traffic.
Splitting a block is the other half of the job. Take a /24 and lend four bits to the network side and you have sixteen /28s, each with fourteen usable hosts — one per VLAN, per floor, per customer. The arithmetic is rigid: every extra bit borrowed doubles the number of subnets and halves the hosts in each, and the boundaries always land on multiples of the block size. This tool shows both ends of that trade at once, so you can pick the split by the number you actually care about.
How it works
Enter the block
Type an address with or without a prefix — 10.0.0.0/8, 192.168.1.0, or an address with a dotted mask after the slash.
Choose how to divide it
Set the mask, then pick either the hosts you need per subnet or the number of subnets. The other follows automatically.
Read off the addresses
Network, broadcast, usable host range and wildcard mask are calculated instantly, with every resulting subnet listed below.
Frequently asked questions
- Why does a /24 have 254 hosts and not 256?
- The first address in the block is the network address — the identity of the segment itself — and the last is the broadcast address, which reaches every host on it at once. Neither can be assigned to a machine, so 256 total addresses leave 254 usable. The same rule scales: a /25 gives 126, a /26 gives 62, a /27 gives 30.
- What is a wildcard mask for?
- It is the subnet mask with every bit inverted, and it is the notation Cisco IOS expects in access control lists and OSPF network statements. Where a mask reads 255.255.255.0, the wildcard reads 0.0.0.255. A zero bit means the bit must match, a one bit means it is ignored — the exact opposite of a mask, which is why the two are so easy to transpose by accident.
- How do I choose a prefix length?
- Start from the number of hosts the segment must hold, add room for growth and for the router and any infrastructure addresses, then take the smallest block that fits. Thirty devices need a /26 rather than a /27, because a /27 gives exactly 30 usable addresses and leaves nothing for a gateway. Resist making every subnet a /24 out of habit — it wastes address space you may need later for more segments.
- What makes an address private?
- RFC 1918 reserves three ranges for internal use — 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 — and they are never routed on the public internet, which is why they can be reused inside every organisation simultaneously. The tool also flags 100.64.0.0/10, reserved for carrier-grade NAT, and 169.254.0.0/16, the link-local range a machine assigns itself when DHCP fails.
- Why are /31 and /32 handled differently?
- A /31 has only two addresses, so reserving one for the network and one for broadcast would leave none for hosts. RFC 3021 allows both to be used on point-to-point links, where there are exactly two ends and no broadcast is needed, and that is what this calculator reports. A /32 is a single address — a host route or a loopback — and has no range to speak of.
- Do the subnets have to be the same size?
- Not in practice. This tool divides a block into equal subnets, which is the common case and the easiest to reason about, but real networks often use variable-length masks: a /24 carved into one /25, one /26 and two /27s to match segments of different sizes. Work that out by subnetting each piece in turn, taking the next unused block as the input each time.
- Is anything I enter sent to a server?
- No. Every value here is thirty-two bits of arithmetic that your browser performs locally, so no address, mask or block ever leaves the page. That matters more than it sounds: an internal addressing plan is genuine reconnaissance material, and pasting one into a website that logs it is a small but real disclosure.
