Subnet Calculator

The Subnet Calculator finds the network address, broadcast address, subnet mask, and usable host range for any IPv4 address and CIDR prefix.

How subnet math works

A CIDR prefix like /24 defines how many bits of a 32-bit IPv4 address are the network portion versus the host portion. The subnet mask, network address, and broadcast address are all derived using bitwise AND/OR operations against the address:

Network Address = IP AND Subnet Mask Broadcast Address = Network Address OR Wildcard Mask Total Hosts = 2(32 − prefix) Usable Hosts = Total Hosts − 2

Two addresses in every subnet are reserved: the network address (all host bits 0) and the broadcast address (all host bits 1) — so usable host addresses are the total minus two (except for /31 and /32, which are special cases).

Example: 192.168.1.10/24 has a network address of 192.168.1.0, broadcast address of 192.168.1.255, subnet mask 255.255.255.0, and 254 usable host addresses from 192.168.1.1 to 192.168.1.254.

Common uses

Network administrators use subnetting to divide larger networks into smaller, more manageable segments for security and routing efficiency. For generating strong network device passwords, see the Password Generator.

Related Calculators