Calculate the Network, Broadcast, and Usable Hosts for Any CIDR Block
CIDR notation like 192.168.1.0/24 is how modern networks describe an address block, but reading it by hand takes practice. The prefix length after the slash determines the subnet mask, the number of addresses, and — once you subtract the network and broadcast addresses — how many hosts you can actually assign. Getting this wrong leads to firewalls that block the wrong ranges, VPCs that run out of IPs, and subnet plans that do not fit. This CIDR calculator removes the arithmetic: enter a block and it returns the network address, broadcast address, subnet mask, wildcard mask, first and last usable hosts, and total capacity. Everything is computed instantly in your browser.
How to Use the CIDR Calculator
- Type your block in CIDR notation, for example
10.0.0.0/24, into the input field. - Confirm the prefix length — the number after the slash — matches your intent.
- Read the network address, which is the first address of the block and identifies the subnet itself.
- Check the broadcast address, the last address, which is never assigned to a host.
- Review the usable host range between them and the total host count.
- Use the values to write firewall rules, configure DHCP scopes, or size a cloud VPC.
Real Example: Input and Output
Sizing a small office network is a common task. A /24 block fits most offices, while a /30 is exactly enough for a point-to-point link between two routers.
| Input | Network | Broadcast | Usable Hosts |
|---|---|---|---|
192.168.1.0/24 | 192.168.1.0 | 192.168.1.255 | 254 |
10.0.0.0/30 | 10.0.0.0 | 10.0.0.3 | 2 |
172.16.0.0/16 | 172.16.0.0 | 172.16.255.255 | 65,534 |
Tips for Subnet Planning
- Reserve the gateway — most networks assign the first usable address, such as
192.168.1.1, to the router and keep it out of DHCP. - Point-to-point links — use a
/30(two usable hosts) or a/31when both ends are routers and broadcast is not needed. - Grow before you need to — pick a block with headroom; renumbering a production subnet is painful.
- Think in powers of two — each prefix step of one doubles or halves the address count, so
/23has 510 usable hosts versus 254 for/24.
When to Use This Tool
- VPC sizing — choose CIDR blocks for cloud subnets before you deploy instances.
- Firewall rules — convert an address range into an exact CIDR block for allow lists.
- DHCP scopes — confirm how many clients a scope can serve before exhaustion.
- Network exams and study — verify subnetting math while learning IP addressing.
Frequently Asked Questions
Why are two addresses subtracted from the total?
The first address of a block is the network address, which identifies the subnet, and the last is the broadcast address, which reaches every host on it. Neither can be assigned to a device, so usable hosts equal the total minus two.
What is the subnet mask for a /24?
A /24 corresponds to the mask 255.255.255.0. Every prefix length maps to one mask; the calculator shows both forms so you can use whichever your equipment expects.
How many usable hosts are in a /24?
Exactly 254. The block contains 256 addresses, minus one network address and one broadcast address.
Is a /31 subnet usable?
Yes, for point-to-point links. RFC 3021 allows a /31 with two usable addresses and no broadcast, which is common on router-to-router links where every address counts.
What does the prefix length actually mean?
It is the number of leading 1 bits in the subnet mask. A /24 means the first 24 bits identify the network and the remaining 8 bits identify hosts within it.
What is the broadcast address used for?
Packets sent to the broadcast address reach every host on the subnet. It is used by protocols such as ARP and DHCP for discovery, and it is never assigned to a single device.
How do I choose a CIDR block for a new VPC?
Pick a private range that does not overlap your other networks, such as 10.0.0.0/16, then split it into subnets sized for each tier with headroom for growth.
Does CIDR apply to IPv6?
Yes. IPv6 uses the same notation, for example 2001:db8::/64, but the host math differs because IPv6 has no broadcast address and the usable count is effectively the full block.