Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path
CIDR Calculator
An IPv4 subnet calculator. Enter a CIDR block like 10.0.0.0/24 and instantly see the network address, broadcast address, usable host range, total and usable host counts, the subnet mask and wildcard mask, and the binary breakdown. Handy for planning VPC subnets, firewall rules and route tables — all computed in your browser.
- Network address
- 10.0.0.0
- Broadcast address
- 10.0.0.255
- Usable host range
- 10.0.0.1 – 10.0.0.254
- Total addresses
- 256
- Usable hosts
- 254
- Subnet mask
- 255.255.255.0
- Wildcard mask
- 0.0.0.255
- Prefix
- /24
Binary breakdown
Address 00001010.00000000.00000000.00000000 Netmask 11111111.11111111.11111111.00000000 Network 00001010.00000000.00000000.00000000
A subnet is arithmetic, not memorization. An IPv4 address is 32 bits, and a CIDR block splits those bits into a fixed network part and a variable host part. The /24 in 10.0.0.0/24 says the first 24 bits are the network and the last 8 are free for hosts. That one number determines every other answer this calculator prints.
What it computes
The tool converts the four octets into one 32-bit integer and applies bitwise operations:
mask = prefix ones, then (32 − prefix) zeros
wildcard = NOT mask
network = address AND mask
broadcast = network OR wildcard
total = 2^(32 − prefix)
usable = total − 2 (/31 gives 2, /32 gives 1)
host range = network + 1 to broadcast − 1
- The network address has every host bit set to 0. It names the subnet.
- The broadcast address has every host bit set to 1. A packet sent there reaches every host on the subnet.
- The wildcard mask is the inverse of the subnet mask, used by access lists and some routing protocols.
- For /31 the range is both addresses, following RFC 3021 for point-to-point links. For /32 it is the single address.
Input must be four decimal octets from 0 to 255, a slash and a prefix from 0 to 32. Anything else gets an error message instead of a result.
A worked example
The default block is 10.0.0.0/24. The prefix leaves 8 host bits, so the mask is 24 ones and 8 zeros, 255.255.255.0, and the wildcard is 0.0.0.255. The address is already aligned, so the network is 10.0.0.0 and the broadcast is 10.0.0.255. That gives 256 total addresses, 254 usable hosts, and a host range of 10.0.0.1 – 10.0.0.254.
An unaligned address shows why the AND matters. Enter 172.16.5.130/26:
Address 10101100.00010000.00000101.10000010
Netmask 11111111.11111111.11111111.11000000
Network 10101100.00010000.00000101.10000000
| Field | Result |
|---|---|
| Network address | 172.16.5.128 |
| Broadcast address | 172.16.5.191 |
| Usable host range | 172.16.5.129 – 172.16.5.190 |
| Total / usable | 64 / 62 |
| Subnet mask | 255.255.255.192 |
| Wildcard mask | 0.0.0.63 |
The last octet, 130, is 10000010. The mask keeps only its top two bits, 10, which is 128, so the host belongs to the block that starts at .128 and ends 63 addresses later at .191.
Assumptions and limits
- IPv4 only. IPv6 prefixes such as
2001:db8::/32are not parsed. - One block at a time. The tool does not split a block into subnets, merge blocks or check whether two ranges overlap.
- RFC rules, not provider rules. Usable counts follow the standard two reserved addresses. Cloud platforms reserve more per subnet, so the real count there is lower.
- No address-class checks. Private, public, multicast and reserved ranges are all calculated the same way, without warnings.
How to use the result
- Size from hosts up. Pick the smallest prefix whose usable count covers today’s hosts with room to double. Subnets are hard to resize once they are in use.
- Align child blocks. A /26 must start on a multiple of 64 in its last octet. Entering a candidate shows the real network address, which exposes a misaligned plan.
- Copy masks exactly. Use the subnet mask for interface and route configuration and the wildcard for access lists that expect it. Mixing the two is a classic way to open or block the wrong range.
- Plan for connections. If two networks may be joined later, choose non-overlapping private ranges now.
How it works
- Parses an IPv4 CIDR (e.g. 10.0.0.0/24) with pure bitwise math.
- Network, broadcast, first/last usable host and total/usable counts.
- Subnet mask, wildcard mask, and per-octet binary breakdown.
- Handles /31 (RFC 3021) and /32 edge cases correctly.
Frequently asked questions
What does the /number in a CIDR block mean?
The suffix is the prefix length: how many leading bits of the 32-bit IPv4 address are fixed as the network portion. /24 means the first 24 bits identify the network and the remaining 8 bits identify hosts, giving 2 to the power 8, or 256, addresses. A smaller number means a bigger block: /16 is 65,536 addresses and /8 is 16,777,216. Each step down doubles the size. The prefix also sets the subnet mask, so /24 is 255.255.255.0.
How many usable hosts are in a /24, /26 or /28?
A block has 2 to the power (32 minus the prefix) addresses, and two of them are reserved, so a /24 has 256 addresses and 254 usable hosts, a /25 has 128 and 126, a /26 has 64 and 62, a /27 has 32 and 30, a /28 has 16 and 14, a /29 has 8 and 6, and a /30 has 4 and 2. Each extra prefix bit halves the block. The exceptions are /31 and /32, covered below, where nothing is reserved.
Why are usable hosts two fewer than the total?
In a normal subnet the first address is the network address, with all host bits 0, and the last is the broadcast address, with all host bits 1. Neither can be assigned to a host, so usable equals total minus 2. The exceptions are /31, which RFC 3021 allows on point-to-point links with both addresses usable because neither end needs a broadcast, and /32, which is a single host route. This calculator applies those two rules automatically.
What is the wildcard mask for?
The wildcard mask is the bitwise inverse of the subnet mask: for a /24, the mask is 255.255.255.0 and the wildcard is 0.0.0.255. Its 1 bits mark the positions that do not matter when matching an address. Cisco-style access control lists and OSPF network statements match ranges with wildcards instead of subnet masks, so you often need both forms of the same range, and the tool shows them side by side.
How do I use this to plan cloud subnets?
Pick a parent block for the VPC, such as 10.0.0.0/16, then carve it into longer prefixes that do not overlap: /24s of 256 addresses for small tiers, or /20s of 4,096 for larger ones. Leave unallocated space for growth and for peering with other networks. Cloud providers also reserve addresses in every subnet, five on AWS and Azure and four on Google Cloud, so a /24 there gives 251 or 252 usable addresses rather than the 254 shown here.
Which IPv4 ranges are private?
RFC 1918 sets aside three blocks for private networks that are never routed on the public internet: 10.0.0.0/8, with about 16.8 million addresses, 172.16.0.0/12, covering 172.16.0.0 to 172.31.255.255, and 192.168.0.0/16. Home routers usually use part of 192.168.0.0/16, and cloud VPCs commonly use 10.0.0.0/8. When networks will be connected later, by VPN or peering, choose ranges that do not overlap, because overlapping private blocks cannot be routed to each other cleanly.