About this calculator
Every IPv4 address belongs to a subnet, defined by a prefix length (CIDR, such as /24) or the equivalent subnet mask (255.255.255.0). Enter any address and its prefix or mask to find the subnet’s network address, broadcast address, the range of addresses that devices can use, and how many there are. Use it when planning a workshop or office network, setting a fixed address on a PLC, printer or CNC machine, or checking why two devices cannot see each other.
This is a calculator only: it works out addresses from the numbers you type and does not scan or contact any network.
Formula
Network = address AND mask Broadcast = network OR (NOT mask)
Total addresses = 2(32 − prefix) Usable hosts = 2(32 − prefix) − 2
Usable hosts run from network + 1 to broadcast − 1. Special cases: a /31 has two addresses, both usable on a point-to-point link (RFC 3021); a /32 is a single address. Wildcard mask = NOT mask (used in router access lists).
Worked example
- 192.168.1.25/24: network 192.168.1.0, broadcast 192.168.1.255, hosts 192.168.1.1 – 192.168.1.254 (254 usable of 256).
- 192.168.1.25/26 (mask 255.255.255.192): network 192.168.1.0, broadcast 192.168.1.63, hosts .1 – .62 (62).
- 10.20.30.40/20: network 10.20.16.0, broadcast 10.20.31.255, 4094 usable hosts.
Assumptions and limitations
- IPv4 only. Leading zeros in an octet (such as 010) are rejected because some systems read them as octal.
- Usable-host counts assume the normal convention that the network and broadcast addresses are not given to devices (except /31 and /32). The router or gateway also uses one of the usable addresses.
- Address types are identified from the IANA special-purpose ranges in the RFCs named; local network policies may differ.
References
- IETF RFC 791 (Internet Protocol), RFC 4632 (CIDR), RFC 950 (subnetting), RFC 3021 (/31 point-to-point links), RFC 1918 (private addresses), RFC 6890 (special-purpose address registries).
