Savvy Calculator

Subnet Calculator

Calculate the network address, broadcast address, usable host range and mask for an IPv4 subnet.

You can also paste CIDR notation like 192.168.1.10/24 into the IP box.

Subnet

Enter an IPv4 address and a prefix length or subnet mask.

How the subnet calculator works

Enter an IPv4 address and a prefix length or subnet mask, or paste both together in CIDR form such as 192.168.1.10/24. The calculator shows the network and broadcast addresses, the range of usable host addresses, the number of hosts, the subnet and wildcard masks, the mask in binary and whether the address is in a private range.

IP addresses, masks and prefixes

An IPv4 address is 32 bits, written as four numbers from 0 to 255. A subnet mask marks how many of those bits identify the network; the rest identify devices (hosts) on it. The prefix length, the number after the slash, counts the network bits: /24 means the first 24 bits are the network, which is the mask 255.255.255.0.

Addresses in the subnet = 2^(32 − prefix)

Usable hosts = addresses − 2 (for /30 and larger networks)

Example: For 192.168.1.10/24, the network is 192.168.1.0 and the broadcast address is 192.168.1.255. That leaves 192.168.1.1 to 192.168.1.254 for devices: 254 usable hosts out of 256 addresses. The address 10.0.5.77 with mask 255.255.255.192 is in the /26 network 10.0.5.64, with hosts from 10.0.5.65 to 10.0.5.126.

Two addresses are not usable for hosts: the first identifies the network itself and the last is the broadcast address for messages to every device on it. A /31 is the exception, used for point-to-point links with both addresses usable, and a /32 is a single host.

Common subnet sizes

Prefix, mask and hosts
PrefixSubnet maskAddressesUsable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/24255.255.255.0256254
/26255.255.255.1926462
/28255.255.255.2401614
/30255.255.255.25242

A wildcard mask is the subnet mask with every bit flipped, so /24 has the wildcard 0.0.0.255. It is used in router access lists and some routing protocols. The private ranges 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (RFC 1918) are reserved for home and company networks and are not routed on the public internet.