CJaraTech /

TECH TOOL / 04

Subnet calculator.

Less subnet math. More clarity.

IPv4CIDR or subnet maskCalculated in your browser

Example values are loaded. Replace them with your own address. A pasted /prefix takes precedence over the mask field.

Try an example

START WITH THE CAPACITY

How many hosts?

Find the smallest subnet for a conventional IPv4 LAN, reserving one network and one broadcast address. This is capacity math; it does not account for gateways or other addresses you need to reserve.

For ordinary LAN sizing the smallest suggestion is /30. /31 is for compatible point-to-point links; /32 describes a single address.

Common IPv4 prefixes
Usable counts reserve network and broadcast addresses, except /31 point-to-point links and /32 host addresses.
PrefixSubnet maskTotalUsable
CIDR, masks, and the /31–/32 exceptions

CIDR: /24 means the first 24 of 32 bits are network bits. That leaves 8 host bits and 2⁸ = 256 addresses.

Subnet mask: 255.255.255.0 represents the same /24 prefix. A valid mask has consecutive 1 bits followed by consecutive 0 bits.

Wildcard: 0.0.0.255 is the inverse of a /24 mask. Some access-control rules use this notation.

/31: On compatible point-to-point links, both addresses can be used (RFC 3021); there is no subnet-directed broadcast. This differs from an ordinary LAN.

/32: One specific IPv4 address, commonly used in host routes. There is no separate network or broadcast reservation.

IPv6: This calculator covers IPv4 only. IPv6 has different address and broadcast conventions.