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.
When to use it, and when not
Use it whenever one block is in question: checking that a route, firewall rule or security group covers the addresses you think it does, finding which subnet a host in a log belongs to, or confirming that a block you are about to create starts on its boundary. Paste a host address with the prefix and the network address it prints is the block the host sits in.
It is the wrong tool for a whole address plan. Carving a VPC into tiers, checking a dozen blocks for overlap, or summarising routes into one shorter prefix all involve many blocks at once. Do those in a spreadsheet or with a library such as Python’s ipaddress, and use the calculator to spot-check each block. For IPv6 you need a different tool altogether.
Trade-offs and limits
The arithmetic is exact. What it leaves out is how many addresses you can really use:
| Ignored | Effect | Example |
|---|---|---|
| Cloud reservations | Five addresses per subnet on AWS and Azure, four on Google Cloud, not two | A /28 shows 14 usable; on AWS it is 11 |
| Subnet size rules | Providers cap the prefix range; AWS allows /16 to /28 | A /29 or /30 that the tool accepts cannot be created there |
| Addresses used by infrastructure | Load balancers, gateways and some Kubernetes network plugins draw addresses from the same subnet | When every pod takes a subnet address, a /24 runs out long before 251 machines |
| Other blocks | No overlap check | 10.0.1.0/23 silently covers 10.0.0.0/24 as well |
Two tricks stretch one block at a time a long way. First, the block size in the octet where the mask changes is 256 minus that mask octet: 248 gives blocks of 8, 192 gives blocks of 64. Networks start on multiples of that size, so you can often place an address in your head and use the tool to confirm. Second, the tool can answer containment. Aligned blocks either nest or do not touch, so to ask whether 10.0.4.0/24 sits inside 10.0.0.0/22, enter 10.0.4.0/22. The network comes back as 10.0.4.0, not 10.0.0.0, so it does not: that /22 ends at 10.0.3.255.
Common mistakes
- Writing a host address where a network belongs.
192.168.1.77/24describes a host; the route is192.168.1.0/24. Some tools reject the first form outright: Python’sipaddress.ip_networkraises “has host bits set” unless you passstrict=False. - Misaligned blocks that overlap a neighbour. A /23 must start on an even third octet. Enter
10.0.1.0/23and the network comes back as10.0.0.0, so the block also covers 10.0.0.0/24, which may already belong to another tier. - Reading the prefix backwards. A bigger number is a smaller block. A /28 holds 16 addresses and a /20 holds 4,096; asking for “a /28 for the cluster” leaves room for 14 hosts.
- Colliding with defaults you did not choose. Docker’s default bridge network is 172.17.0.0/16. A VPC or VPN range inside it makes those addresses unreachable from containers on that host.
- Using home-router ranges for a company network. 192.168.0.0/24 and 192.168.1.0/24 are common router defaults, so remote staff on VPN often already have the same block at home, and traffic for it never leaves their house.
Check yourself
Which network does 10.20.37.200/21 belong to, and what is its usable range?
A /21 leaves 11 host bits, so blocks are 8 wide in the third octet. 37 falls in the block starting at 32, which is 37 AND 248. Network 10.20.32.0, broadcast 10.20.39.255, hosts 10.20.32.1 – 10.20.39.254: 2,048 addresses, 2,046 usable, mask 255.255.248.0.
How many /26 subnets fit in 10.0.0.0/22, and how many hosts does each hold?
Each extra prefix bit halves the block, so a /22 holds 2^(26 − 22) = 16 blocks of /26. Each has 64 addresses and 62 usable hosts, or 59 on AWS.
What is the smallest block for 500 hosts?
A /24 gives 254, too few. A /23 gives 2^9 − 2 = 510, and still 507 after AWS’s five reserved addresses. So a /23, though the advice to leave room to double points to a /22.
What wildcard mask goes with a /20?
The mask is 20 ones, 255.255.240.0. The wildcard flips every bit: 0.0.15.255, because the 12 host bits are 4 in the third octet, 15, and 8 in the fourth, 255.
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.