A router deciding where to forward a packet performs one operation over and over: it masks the destination address down to a network number and matches that against its table. This calculator runs the same arithmetic in front of you, so a CIDR block becomes a full picture — network, host range, broadcast, netmask and wildcard — the moment you type it.
How to use
- Type an address and mask into the single field: CIDR form like
192.168.1.0/24, an address plus dotted netmask like172.16.8.1 255.255.252.0, or an IPv6 prefix such as2001:db8::/48. - Prefer a running start? Click one of the example chips beneath the field to load a ready-made block, then edit it.
- Read the stats row for prefix length, total addresses and usable hosts — the last figure already accounts for the network and broadcast reservations.
- Copy any computed value straight from its row: normalised CIDR, network address, first and last host, broadcast, netmask or wildcard.
- Glance at the binary panel to see exactly where the network/host boundary sits; the highlighted bits are the network portion.
There is no calculate button — every result recomputes on each keystroke.
How it works
The core is a bitwise AND between the address and a mask derived from the prefix length. For IPv4 the tool works in 32-bit unsigned integers (using JavaScript’s >>> to stay unsigned); for IPv6 it switches to 128-bit BigInt arithmetic, since the counts overflow ordinary numbers.
Take 198.51.100.164/27. A /27 sets the first 27 bits as network, leaving 5 host bits, so the mask is 255.255.255.224 — that final 224 is 11100000 in binary. ANDing the last octet, 164 (10100100), with 224 (11100000) keeps only the top three bits: 10100000, which is 160. So the true network is 198.51.100.160, and because you typed .164 the tool notes that your input was a host inside that block rather than the network itself.
From there the rest falls out. The wildcard is the mask inverted, 0.0.0.31; ORing it with the network gives the broadcast, 198.51.100.191. The usable range is everything between: first host 198.51.100.161, last host 198.51.100.190. Total addresses are 2⁵ = 32, and usable hosts are 32 − 2 = 30, subtracting the network and broadcast.
Two edge cases are handled explicitly rather than by the generic formula. A /31 returns two usable addresses under RFC 3021 for point-to-point links, with no broadcast; a /32 is reported as a single host route. The tool also rejects a dotted mask whose 1-bits are not contiguous — 255.255.0.255 is not a valid netmask — and if you paste a wildcard mask by mistake, it tells you the netmask equivalent.
Use cases & limitations
Reach for a subnet calculator when carving an allocation into VLANs, sizing a DHCP scope, writing a firewall rule, or translating a prefix into the wildcard form that Cisco ACLs and OSPF statements expect. It is equally handy for the reverse question — given a host address and a netmask, which subnet does it belong to? Everything runs in the browser, so it works offline once loaded and against internal ranges you would never paste into a remote service.
The honest limitation: it describes the geometry of one block at a time. It will not split a parent network into a VLSM plan for you, check whether two subnets overlap, or tell you if an address is actually routed or assigned — those are design decisions, not arithmetic. It also computes structure, not reachability; use DNS Lookup to resolve names and What Is My IP to see your own public address. If the binary panel leaves you wanting to convert masks between bases by hand, the Number Base Converter handles the decimal-to-binary step directly.