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.
- The address is parsed into a single integer (32-bit for IPv4, 128-bit for IPv6 using
BigInt). - A network mask is built with the top prefix bits set to 1 and the rest to 0.
network = address AND maskclears the host bits to give the base address.broadcast = network OR (NOT mask)sets every host bit to 1, giving the last address in the range.- Total addresses =
2^(bits − prefix). For IPv4, usable hosts = total − 2 (network + broadcast), with/31and/32handled 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:
| Field | Value |
|---|---|
| Subnet mask | 255.255.252.0 |
| Wildcard mask | 0.0.3.255 |
| Network address | 10.0.0.0 |
| Broadcast address | 10.0.3.255 |
| First usable host | 10.0.0.1 |
| Last usable host | 10.0.3.254 |
| Total addresses | 1,024 |
| Usable hosts | 1,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
| Feature | IPv4 | IPv6 |
|---|---|---|
| Address size | 32 bits | 128 bits |
| Broadcast address | Yes (last address) | No (uses multicast instead) |
| Usable hosts | Total − 2 | Total (no broadcast reservation) |
| Notation | Dotted decimal + prefix | Hex 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.