Subnet Calculator

IPv4 subnet calculator — network and broadcast addresses, subnet mask, host range and host counts from an IP and CIDR prefix.

e.g. 192.168.1.10

Your result will appear here

Fill in the fields and press Calculate.

Enter an IPv4 address and a CIDR prefix, and this calculator works out the whole subnet: the network and broadcast addresses, the subnet and wildcard masks, the usable host range, and how many hosts the subnet holds. It’s the everyday tool for planning and troubleshooting IP networks.

How is it calculated?

CIDR and the mask

The prefix (like /24) is how many leading bits belong to the network. Those bits form the subnet mask; the rest address hosts:

CIDRSubnet maskHost bitsTotal addresses
/24255.255.255.08256
/25255.255.255.1287128
/30255.255.255.25224

Network, broadcast and hosts

  • Network address — the IP with all host bits 0; names the subnet.
  • Broadcast address — all host bits 1; reaches every host at once.
  • Usable hosts — everything in between: total addresses minus 2 (the network and broadcast), for prefixes up to /30.

The wildcard mask is the inverse of the subnet mask (used in ACLs and OSPF).

Special cases

/31 subnets carry 2 usable addresses for point-to-point links (RFC 3021), and /32 is a single host — the calculator handles both rather than subtracting 2.

Worked example

Take 192.168.1.10 with a /24 prefix. The mask is 255.255.255.0, so the network address is 192.168.1.0 and the broadcast is 192.168.1.255. That leaves 254 usable hosts, from 192.168.1.1 to 192.168.1.254, and a wildcard mask of 0.0.0.255. Change the prefix to /30 and you get just 4 addresses — 2 usable — the size used for a link between two routers.

FAQ

What does a subnet calculator do?+

It takes an IP address and a CIDR prefix (or mask) and derives the subnet’s details: network and broadcast addresses, subnet and wildcard masks, the first and last usable host, and the number of hosts — the information you need to plan or troubleshoot a network.

How many usable hosts does a /24 have?+

A /24 has 256 total addresses and 254 usable, because the network address (.0) and the broadcast address (.255) can’t be assigned to hosts. In general, usable hosts = 2^(32 − prefix) − 2 for prefixes up to /30.

What is the difference between the network and broadcast address?+

The network address has all host bits set to 0 and identifies the subnet itself; the broadcast address has all host bits set to 1 and is used to reach every host in the subnet at once. Neither can be assigned to an individual device.

What is a wildcard mask?+

The bitwise inverse of the subnet mask — for 255.255.255.0 it’s 0.0.0.255. Wildcard masks are used in access control lists and routing protocols like OSPF to specify which address bits to match.

Why do /31 and /32 behave differently?+

Normally 2 addresses are reserved (network and broadcast), but a /31 is defined for point-to-point links with both addresses usable (RFC 3021), and a /32 is a single host address. The calculator applies these special cases instead of subtracting 2.