Home / Subnet calculator
IPv4 Subnet Calculator
Enter an address and a prefix length (or a dotted netmask). The calculator returns the network address, broadcast address, usable host range and a full bit-by-bit breakdown — plus how each value is derived.
/24 or 255.255.255.0How the result is derived
Every subnet calculation rests on one operation: a bitwise AND between the address and the mask.
1. Turn the prefix into a mask
A prefix of /24 means the first 24 bits are 1 and the rest are 0, which is 11111111.11111111.11111111.00000000 — that is 255.255.255.0 in decimal. The number after the slash is the count of leading ones.
2. AND the address with the mask
Line the address up with the mask and keep a bit only where both are 1. The result is the network address — the first address in the block, where every host bit is 0.
11000000.10101000.00001010.00100101 192.168.10.37
| 11111111.11111111.11111111.00000000 255.255.255.0
= 11000000.10101000.00001010.00000000 192.168.10.0
3. Invert the mask for the broadcast
The wildcard mask is the bitwise inverse of the subnet mask. OR the network address with the wildcard and every host bit becomes 1 — that is the broadcast address, the last address in the block.
11000000.10101000.00001010.00000000 192.168.10.0
| 00000000.00000000.00000000.11111111 0.0.0.255
= 11000000.10101000.00001010.11111111 192.168.10.255
4. Count the hosts
With h host bits you get 2h addresses in total. The network and broadcast addresses are reserved, so a normal subnet gives 2h − 2 usable hosts. /24 has 8 host bits, so 256 total and 254 usable — from .1 to .254.
Two edge cases break that rule: /31 (RFC 3021 point-to-point) both addresses are usable, and /32 is a single host with no network or broadcast address at all.
Notes on address types
| Range | Meaning |
|---|---|
| 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 | Private (RFC 1918) — never routed on the public internet |
| 127.0.0.0/8 | Loopback |
| 169.254.0.0/16 | Link-local / APIPA — self-assigned when DHCP fails |
| 100.64.0.0/10 | Carrier-grade NAT (RFC 6598) |
| 224.0.0.0/4 | Multicast |