Toolman

Subnet mask 240.0.0.0

/4

240.0.0.0 · 268,435,454 usable hosts

CIDR prefix/4
Subnet mask240.0.0.0
Wildcard mask15.255.255.255
Binary11110000.00000000.00000000.00000000
Total addresses268,435,456
Usable hosts268,435,454

How many hosts it holds

268,435,456 addresses, of which 268,435,454 can be assigned to hosts — the first is the network address and the last is the broadcast, and neither goes on an interface.

Reading the mask

A subnet mask is 4 one-bits followed by 28 zero-bits, written as four decimal octets. The ones mark the part of the address that identifies the network and the zeros mark the part that identifies the host, which is why the mask is always a solid run of ones — a mask with a gap in it would split the host part in two and is not valid.

11110000.00000000.00000000.00000000
240.0.0.0

The prefix length is simply the count of those ones, so 240.0.0.0 is /4 and nothing has to be calculated to convert between them.

The wildcard, and where it turns up

Cisco access lists and OSPF network statements take a wildcard mask rather than a subnet mask — the same value with every bit inverted, 15.255.255.255 here. It trips people up because the two look alike and mean opposite things: in a subnet mask a one means "this bit is the network", and in a wildcard a one means "ignore this bit".

Frequently asked questions

What CIDR prefix is 240.0.0.0?

240.0.0.0 is /4. The mask has 4 bits set, and the prefix length is that count.

How many hosts does 240.0.0.0 allow?

268,435,456 addresses in total and 268,435,454 usable, after the network and broadcast addresses are taken out.

What is the wildcard mask for 240.0.0.0?

15.255.255.255 — the mask with every bit flipped. Cisco access lists and OSPF network statements take the wildcard rather than the mask, which is the usual reason to want it.

Other masks

/4 in full · Every subnet mask · CIDR reference