Network/CIDR Calculator

CIDR Calculator

Ranges, masks, host counts and subnetting

Standard IPv4 CIDR arithmetic, no lookups.
CIDR — input
Try one
Enter a network in A.B.C.D/prefix form.

CIDR notation writes a network as an address followed by a slash and a prefix length: 192.168.1.0/24. The prefix is the number of leading bits that identify the network, leaving the rest to identify hosts within it. A /24 fixes 24 bits and leaves 8, which is 256 addresses — 254 of them usable once the network and broadcast addresses are set aside.

The arithmetic is simple and unforgiving. Each step down in prefix length doubles the block: a /23 is two /24s, a /22 is four. Getting it wrong means either a subnet that cannot hold what you put in it or one that overlaps a neighbour, and both are discovered at the least convenient moment. This calculator shows the range, mask and host count for any block.

How to use it

  1. Enter a CIDR blockAn address and a prefix, such as 10.0.0.0/16. If the address has bits set below the prefix, the true network address is shown so you can see what you actually specified.
  2. Read the boundariesNetwork address, broadcast address, first and last usable host, subnet mask and total count are derived together.
  3. Split it into subnetsDivide a block into equal smaller ones to plan an allocation, checking the sizes before anything is committed to a router or a cloud VPC.

Frequently asked questions

How many addresses are in a /24?

256 in total, of which 254 are usable for hosts. The first address is the network identifier and the last is the broadcast address, so neither is assignable. The general rule is 2 to the power of (32 minus the prefix), minus two.

What is the difference between a /24 and a subnet mask of 255.255.255.0?

Nothing — they are two notations for the same thing. The mask writes out the bit pattern in dotted decimal, where 255 is eight set bits, so 255.255.255.0 is 24 ones followed by 8 zeros. CIDR notation just counts them, which is shorter and harder to mistype.

Which address ranges are private?

RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 for private use, and they are not routed on the public internet. 100.64.0.0/10 is set aside for carrier-grade NAT, and 169.254.0.0/16 is link-local — an address in that range usually means DHCP failed.

Why do /31 and /32 behave differently?

A /32 is a single address, used for a loopback or a host route. A /31 would normally have no usable hosts at all once you remove network and broadcast, so RFC 3021 makes an exception: on a point-to-point link both addresses are usable, which saves two addresses on every such link.

How does this change for IPv6?

The notation is identical but the scale is not. A /64 is the standard subnet size and contains more addresses than the entire IPv4 space many times over, so exhausting a subnet stops being a concern. Allocation is about hierarchy and routing rather than conservation, and broadcast addresses do not exist.

Related tools

Nothing left this tab. No request was made, no history was written. Network · CIDR Calculator