CIDR Calculator
Calculate the network address, broadcast, usable host range and total host count for any IPv4 or IPv6 CIDR block.
What is a CIDR calculator?
A CIDR calculator works out the details of a block of IP addresses written in CIDR notation, such as 192.168.1.0/24 or 2001:db8::/32. From that one line it calculates the network address, the subnet and wildcard masks, the broadcast address, the total number of addresses, the usable host count and the first and last usable addresses.
It saves doing binary maths by hand when you plan a network, write firewall rules or check a range someone has given you.
How CIDR notation works
An IPv4 address has 32 bits and an IPv6 address has 128. The number after the slash, called the prefix length, says how many of those bits identify the network. The remaining bits identify individual addresses inside it. A /24 in IPv4 leaves 8 bits for addresses, which gives 2 to the power of 8, or 256 addresses. Each extra bit in the prefix halves the block, so a /25 has 128 and a /26 has 64.
The calculator also accepts an address from inside a block, such as 192.168.1.77/24, and works out the network it belongs to.
How to use the CIDR calculator
- Type a block in CIDR form, for example
10.0.0.0/16or2001:db8::/48. - Press Calculate.
- Read the network address, masks, broadcast and host counts.
- Copy the first and last usable addresses into your plan or firewall rule.
Understanding the CIDR calculator results
Subnet mask and wildcard mask
For IPv4, the prefix is also shown as a subnet mask, such as 255.255.255.0 for /24. The wildcard mask is its inverse, 0.0.0.255, which some router and firewall rules use.
Broadcast and usable hosts
In a normal IPv4 subnet the first address is the network address and the last is the broadcast address, so usable hosts are the total minus two. Two special cases follow common practice: a /32 is a single usable address, and a /31 has two usable addresses for point-to-point links, as described in RFC 3021.
IPv6 blocks
IPv6 has no broadcast address, so no broadcast or masks are shown, and the usable count equals the total. Totals for large IPv6 blocks are shown in full, which can be very long numbers.
Quick reference for common IPv4 blocks
| Prefix | Subnet mask | Addresses | Usable hosts |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /26 | 255.255.255.192 | 64 | 62 |
| /28 | 255.255.255.240 | 16 | 14 |
| /30 | 255.255.255.252 | 4 | 2 |
Private address ranges for your own networks
RFC 1918 reserves three IPv4 blocks for private networks: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Home routers usually use a /24 from the last one. When planning office or cloud subnets, pick ranges from these blocks and avoid overlaps, especially if the networks will later be joined by a VPN. Cloud providers also reserve a few extra addresses in each subnet, so check their documentation before sizing one tightly.
Common uses
- Splitting an office network into smaller subnets, for example separate ones for staff, guests and printers.
- Writing firewall or cloud security rules that allow a whole range.
- Checking whether an address falls inside a block from an IP WHOIS result.
Common problems and fixes
"Not a valid CIDR block". Include the slash and prefix, such as /24. The prefix must be 0 to 32 for IPv4 and 0 to 128 for IPv6.
The network address differs from what you typed. You entered an address inside the block; the calculator shows the block's real starting address.
A firewall rejects the range. Some systems only accept the exact network address, so enter the block's starting address as shown here rather than an address from inside it.
Related tools
- IP WHOIS shows which network block an address belongs to.
- IP Lookup shows the routed range and provider for an address.
- What Is My IP? shows your public address.
Frequently asked questions
What does the /24 in an IP address mean?
It is the prefix length: the first 24 bits of the address identify the network, and the remaining 8 bits identify addresses within it. A /24 therefore contains 256 addresses, of which 254 can be given to devices in a normal IPv4 subnet, with the first and last reserved.
Why are two addresses not usable in a subnet?
In a normal IPv4 subnet, the first address identifies the network itself and the last is the broadcast address used to reach every device at once. Neither can be given to a single device, so usable hosts are the total minus two. The /31 and /32 blocks are the exceptions.
How many usable hosts does a /31 have?
Two. RFC 3021 allows /31 blocks on point-to-point links between two routers, where a network and broadcast address are not needed. The calculator follows this practice, showing both addresses as usable. A /32 is a single address, often used for one host in a firewall rule.
What is a wildcard mask used for?
A wildcard mask is the inverse of the subnet mask: 0.0.0.255 instead of 255.255.255.0. Some routers and firewalls, particularly in access control lists and routing settings, ask for a wildcard mask rather than a prefix or subnet mask. The calculator shows both so you can copy the format you need.
Does the CIDR calculator support IPv6?
Yes. Enter a block such as 2001:db8::/48. You get the network address, the first and last addresses and the total number of addresses. IPv6 has no broadcast address, so every address counts as usable, and subnet masks are not shown because IPv6 uses the prefix length instead.
Can I enter any address inside a block?
Yes. If you type an address such as 192.168.1.77/24, the calculator works out which block it belongs to and shows that block's network address, 192.168.1.0/24, along with its range and host counts. This is a quick way to find the subnet an address sits in.
What CIDR size should I use for a small office?
A /24 with 254 usable addresses suits most small offices and leaves room to grow. Smaller blocks, such as a /26 with 62 hosts, are handy for separate guest or device networks. Plan for growth, because changing a network's size later means changing settings on many devices.