IPv4 and IPv6 ranges
Use the IP Subnet Calculator to find network ranges, masks and address counts for IPv4 and IPv6 CIDR prefixes.
How the calculation works
The prefix fixes the high-order network bits. IPv4 /31 and /32 are shown as point-to-point and single-address ranges respectively.
Address counts and masks
See IPv4 masks and the span of each subnet.
A /24 IPv4 prefix fixes the first 24 bits, leaving 256 total addresses. The subnet mask is 255.255.255.0 and the usual host range excludes the network and broadcast addresses.
Worked example
Example inputs include IPv4 address 192.168.1.45, CIDR prefix length 24. The result is 192.168.1.0/24.
How to read the result
The first and last addresses define the range covered by the prefix. For IPv6, read the full range rather than applying IPv4 broadcast rules to it.
Work out address ranges from CIDR notation
CIDR uses the prefix length to mark which initial bits belong to the network. IPv4 has 32 bits and IPv6 has 128. A longer prefix leaves fewer bits for addresses inside that subnet. Use the first and last addresses to confirm whether an allocation covers the intended range, and check the special handling of point-to-point IPv4 prefixes.
Check boundaries before assigning addresses
A prefix identifies a block of addresses. For example, 192.0.2.34/24 falls within the block from 192.0.2.0 through 192.0.2.255. Review the usable IPv4 range separately from the full block, since network and broadcast endpoints have special roles in ordinary subnets. IPv6 uses a larger address space and has different allocation conventions.
Check a prefix against the addresses you need
Enter an address in the intended block and its prefix length. For example, 192.0.2.34/24 falls in the block between 192.0.2.0 and 192.0.2.255. Check the usable range separately from the full block because ordinary IPv4 subnets reserve the endpoints.
Use the IPv6 tab for an IPv6 allocation. Keep the prefix attached to the address when recording a result. In either address family, a longer prefix leaves fewer bits for addresses in the block.
Common questions
A /31 is commonly used on a point-to-point link, where both addresses can be assigned to endpoints.
It is the prefix length. For example, /24 fixes 24 initial bits of an IPv4 address.
It is the bitwise inverse of an IPv4 subnet mask. The bits that can vary in the subnet are set in the wildcard mask.
It represents one address. All 32 bits are fixed by the prefix.
No. IPv6 uses mechanisms such as multicast for communication to groups, so it has no IPv4-style broadcast address.