IP Subnet Calculator

Calculate an IPv4 network, subnet mask, wildcard mask, address range and usable-host count from an address and CIDR prefix.

Network in CIDR notation192.168.1.0/24

Four decimal octets, for example 192.168.1.42.

bits

0 – 32

Network in CIDR notation

192.168.1.0/24

  • Subnet mask255.255.255.0
  • Wildcard mask0.0.0.255
  • Broadcast address192.168.1.255
  • Usable address range192.168.1.1 – 192.168.1.254
  • Usable addresses254
  • Total addresses256

For /31, both addresses are usable on an RFC 3021 point-to-point link. /32 denotes one host. Other prefixes reserve the first and last addresses. This arithmetic does not determine routability, allocation rights or firewall policy.

How this was calculated

A /p block contains 2^(32 − p) IPv4 addresses.

Clear the host bits to find the network, then set them to find the final address.

Formula and method

A /p block has 2^(32 − p) addresses. Clear host bits for the network boundary. Ordinary subnets reserve network and broadcast addresses; /31 point-to-point links and /32 hosts are handled separately.

Worked example

192.168.1.42/24 belongs to 192.168.1.0/24. Its mask is 255.255.255.0 and ordinary usable addresses run from .1 through .254.

References

Frequently asked questions

Why are there two usable addresses in a /31?

RFC 3021 permits both addresses on a point-to-point link. This does not mean every network type or device supports that configuration.

Last updated . Results are estimates for informational purposes only.