IPv4/IPv6 CIDR Range Calculator

Enter a CIDR and get network address, broadcast, host range, and usable IPs

Compute the full details of any IPv4 or IPv6 CIDR block in your browser: network address, broadcast address, subnet mask, first and last usable host, wildcard mask and total host count. Built for firewall and network security engineers. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What does the prefix length mean?

The prefix length (the number after the slash) is how many leading bits of the address identify the network. A /24 fixes the first 24 bits, leaving 8 bits — 256 addresses — for hosts.

A CIDR block (Classless Inter-Domain Routing) describes a contiguous range of IP addresses using an address and a prefix length, such as 192.168.1.0/24. This calculator expands any IPv4 or IPv6 CIDR into its constituent parts — network address, mask, host range, and address count — entirely in your browser. It is built for firewall rule authors, cloud network engineers, and anyone verifying an allow or block list.

How it works

The prefix length tells you how many leading bits are fixed as the network portion; the remaining bits vary across hosts in that block.

  1. The address is parsed into a single integer (32-bit for IPv4, 128-bit for IPv6 using BigInt).
  2. A network mask is built with the top prefix bits set to 1 and the rest to 0.
  3. network = address AND mask clears the host bits to give the base address.
  4. broadcast = network OR (NOT mask) sets every host bit to 1, giving the last address in the range.
  5. Total addresses = 2^(bits − prefix). For IPv4, usable hosts = total − 2 (network + broadcast), with /31 and /32 handled as special cases.

IPv6 has no broadcast; the tool reports first and last address without reserving one.

IPv4 example: 10.0.0.0/22

A /22 spans 1,024 addresses across four class-C blocks:

FieldValue
Subnet mask255.255.252.0
Wildcard mask0.0.3.255
Network address10.0.0.0
Broadcast address10.0.3.255
First usable host10.0.0.1
Last usable host10.0.3.254
Total addresses1,024
Usable hosts1,022

IPv6 example: 2001:db8::/48

An IPv6 /48 is a typical allocation to an organization. It contains 2^80 addresses — about 1.2 × 10^24. The tool shows:

  • Network: 2001:0db8:0000:0000:0000:0000:0000:0000
  • Last address: 2001:0db8:0000:ffff:ffff:ffff:ffff:ffff
  • Subnets of /64 available within it: 65,536

IPv4 vs IPv6: key differences in this calculator

FeatureIPv4IPv6
Address size32 bits128 bits
Broadcast addressYes (last address)No (uses multicast instead)
Usable hostsTotal − 2Total (no broadcast reservation)
NotationDotted decimal + prefixHex colon + prefix
Max prefix/32 (single host)/128 (single host)

Where CIDR ranges are used in practice

Cloud networking (AWS VPC, Azure VNet, GCP VPC): Each virtual network is defined by a CIDR block, and subnets are sub-ranges within it. The cloud provider reserves a few addresses for internal use, so the usable host count is slightly lower than this calculator shows for raw CIDR.

Firewall allow/block lists: CIDR notation is the standard way to permit a range of IPs in one rule rather than listing individual hosts.

BGP route advertisements: ISPs advertise their address space to the global routing table as CIDR prefixes.

Security group rules: Verifying that a /24 rule covers an address you want to allow (or inadvertently allows something you didn’t intend) is a common use of a CIDR calculator.

A /0 covers the entire address space and should only appear in a “allow all” or “default route” context. IPv6 ranges can be astronomically large, so the tool shows exact address counts as base-10 strings rather than rounding.