CalculaIT / tools
← Home
Tools for IT decisions

IPv4 and CIDR

/31 models point-to-point links; /32 a single host. Real network configuration is not checked.

Quick answer · example

How many hosts fit in a /24 subnet?

An IPv4 /24 contains 256 addresses and normally supports 254 hosts, reserving network and broadcast addresses. For 192.168.1.42/24, the network is 192.168.1.0.

Calculation assumptions

/31 models point-to-point links; /32 a single host. Real network configuration is not checked.

View the worked example ↓

Fields contain editable examples.

Result

Fields contain editable examples.

Formula and assumptions

2^(32−CIDR)

/31 models point-to-point links; /32 a single host. Real network configuration is not checked.

All amounts use the same currency of your choice. These are estimates, not measurements or offers.

How to use this calculator

Enter an IPv4 address and prefix to find subnet boundaries. A larger prefix leaves fewer address bits and creates a smaller block. The tool does not test routing, DHCP, firewalls or connectivity.

Worked example

  1. For 192.168.1.42/24, 32 − 24 = 8 bits remain for addresses.
  2. The block has 2⁸ = 256 addresses: 192.168.1.0 through 192.168.1.255.
  3. A conventional subnet reserves network and broadcast: 256 − 2 = 254 hosts.

Example result

Network
192.168.1.0
Mask
255.255.255.0
Broadcast
192.168.1.255
Hosts
254

Interpreting the result

For DHCP planning, also exclude your gateway, static assignments and reservations. Calculated hosts do not mean addresses currently free on your network.

Frequently asked questions

How is /31 handled?

As a point-to-point special case with two endpoints and no separate network or broadcast reservation. Check device support.

What does /32 represent?

One individual address, not a conventional multi-host subnet.

What is a wildcard?

The complement of the mask: 0.0.0.255 for /24. Access-list usage depends on device syntax.

References and method

RFC 3021 — IPv4 /31 · References and method