What subnetting actually computes
An IPv4 address is 32 bits. A CIDR prefix like /24 says the first 24 bits name the network and the remaining 8 bits name hosts inside it. From that single split, everything else follows: the subnet mask (24 ones followed by 8 zeros, written 255.255.255.0), the network address (host bits all zero), the broadcast address (host bits all one), and the usable hosts in between. This calculator does that bit arithmetic for any address and prefix — or for a netmask you type directly, which overrides the CIDR field.
The two reserved addresses are the network address itself and the broadcast address, so a /24 (256 addresses) yields 254 usable hosts. The exceptions are /31 links (point-to-point, where RFC 3021 allows both addresses to be used) and /32 (a single host route) — this page reports the classic counts and flags those cases in the note.
Worked example
Take 192.168.1.10/24. The mask is 255.255.255.0, so the network address is 192.168.1.0 and the broadcast is 192.168.1.255. Usable hosts run from 192.168.1.1 to 192.168.1.254 — 254 hosts. The wildcard mask (the mask inverted, as used in some router ACLs) is 0.0.0.255.
How to use this calculator
- Type any IPv4 address — the network it belongs to is what matters, not the exact host.
- Set the CIDR prefix, or type a dotted netmask to override it.
- Read the network, broadcast and first/last usable host for your DHCP ranges, ACLs or firewall rules.
- Check the binary rows in the Detail section when you need to see exactly where the split falls.
Choosing a prefix size
Common practice: /24 for a typical office or home LAN (254 hosts), /25–/26 for carving a LAN into smaller segments, /30 for traditional point-to-point links (2 usable hosts), /31 on modern point-to-point links, and /32 for a single-host route such as a loopback. Bigger prefixes waste fewer addresses but leave no room to grow — size subnets for the hosts you will have, not just the hosts you have today. Pair this with the Number Base Converter when you need the same numbers in hex or octal.