CIDR subnet calculator

Enter an IPv4 or IPv6 address with a prefix length. See its network range, split it into smaller prefixes, or check an address for membership.

Calculate IPv4 and IPv6 ranges locally. JavaScript is required for interactive results.

How it works

RFC 4632 and RFC 4291 define a prefix as the leftmost address bits. IPv4 has 32 bits; IPv6 has 128. The mask keeps prefix bits and clears host bits. The wildcard is the inverse mask within the address width.

total = 2^(address bits − prefix length) network = address AND mask last = network + total − 1 number of equal subnets = 2^(new prefix − old prefix)

All arithmetic uses BigInt with no rounding. For ordinary IPv4 subnets, usable bounds exclude network and broadcast. RFC 3021 makes both /31 addresses host addresses on a point-to-point link; /32 is a single host route. These are arithmetic conventions, not an allocation or routing check.

IPv6 has no broadcast. We show range bounds, not a universal “usable host” count: anycast and special-use reservations depend on context. IPv6 output follows RFC 5952: lowercase, no leading zeros, and the first longest zero run compressed; a single zero group stays explicit. IPv4-mapped addresses use mixed notation. Expanded output uses all eight groups.

The local display limit is 256 subnets. Larger splits show the exact total and clearly mark omitted rows. Each text field is limited to 256 characters or less.

Worked examples

IPv4 /26

192.168.1.130/26 normalizes to 192.168.1.128/26. It contains 64 addresses; usable bounds are 192.168.1.129–192.168.1.190 (62 addresses). Broadcast is 192.168.1.191, mask is 255.255.255.192, and wildcard is 0.0.0.63. Splitting to /28 gives 4 subnets starting at .128, .144, .160 and .176.

IPv6 /64

2001:db8::1234/64 has network 2001:db8:: and 18,446,744,073,709,551,616 addresses. Its final address is 2001:db8::ffff:ffff:ffff:ffff. Splitting to /66 gives 4 subnets.

Point-to-point /31

192.0.2.10/31 contains 2 endpoints: 192.0.2.10 and 192.0.2.11. Both are usable on a point-to-point link, with no directed broadcast.

Frequently asked questions

Does the address need to be the network address?
No. Host bits are cleared automatically. For example, 192.168.1.130/26 becomes 192.168.1.128/26.
What is different about /31 and /32?
A /31 has two host addresses on a point-to-point link under RFC 3021. A /32 contains one IPv4 address and represents a host route.
Does IPv6 have a broadcast address?
No. RFC 4291 uses multicast instead of broadcast. The last address shown is only the upper bound of the prefix.
Can I split into any number of equal CIDR subnets?
A complete split into equal CIDR prefixes has a power-of-two count. Increasing the prefix length by 2 creates 4 subnets. Only the first 256 are listed.
Does membership mean an address is assignable?
No. Membership includes the entire prefix, including IPv4 network and broadcast addresses. It does not check special-use reservations, routing, or provider policies.
Are IPv6 zone IDs or ports accepted?
No. Enter a bare address and prefix. IPv4 tails in IPv6 addresses are accepted; zone IDs, brackets, and ports are rejected.

Sources

Last reviewed 2026-11-14. The method is written out above so you can check our math.