Subnet & CIDR Calculator
Work out the network address, broadcast, subnet mask, host range and usable hosts for any IPv4 CIDR block.
- Network address
- —
- Broadcast address
- —
- Subnet mask
- —
- Wildcard mask
- —
- CIDR notation
- —
- Usable host range
- —
- First usable host
- —
- Last usable host
- —
- Usable hosts
- —
- Total addresses (block size)
- —
- Address class
- —
- Address scope
- —
Address in binary—
Mask in binary—
Network in binary—
Split this block into smaller subnets
Pick a longer prefix to divide the block. Splits are limited to 256 subnets at a time.
| # | Network | First host | Last host | Broadcast | Usable hosts |
|---|
How it works
Type an address with or without a slash — 10.0.0.0/8, 172.16.5.130/26
or just 192.168.0.1 with the prefix picked from the dropdown. Every field
recalculates as you type.
This is a classful-free CIDR calculator: the prefix length /n says how many leading bits belong to the network, so the subnet mask is n ones followed by 32 − n zeros. The network address is the address bitwise-ANDed with that mask, the broadcast address is the network ORed with the wildcard mask (the mask inverted), and the block holds 232−n addresses. For /30 and shorter the first and last addresses are reserved for the network and broadcast, so the usable host count is 232−n − 2 — a /24 gives 256 addresses and 254 hosts, a /26 gives 64 addresses and 62 hosts.
Two prefixes are special. A /31 is treated as an RFC 3021 point-to-point link: both addresses are usable, so it reports 2 hosts and no broadcast. A /32 is a single host route. The scope line flags RFC 1918 private space (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) plus loopback, link-local, shared CGNAT, multicast and reserved ranges; the class line is the legacy A–E classification, kept for exam questions rather than routing.
Everything is computed with 32-bit integer arithmetic in your browser — nothing about your network is sent anywhere, there is no sign-up and there are no ads. Copy the summary, download it as text, or export a split into a CSV of subnets.
Frequently asked questions
How many usable hosts does a /26 have?
A /26 covers 2^(32−26) = 64 addresses. The first is the network address and the last is the broadcast address, so 62 are usable for hosts. The same rule gives 254 hosts for a /24, 126 for a /25, 30 for a /27 and 2 for a /30.
How do I find the network and broadcast address from a CIDR block?
The subnet mask is the prefix length written as that many 1 bits followed by 0s. Bitwise-AND the address with the mask to get the network address, then bitwise-OR the network with the wildcard mask (the mask inverted) to get the broadcast address. This calculator shows both, plus the binary form of each.
Why does a /31 show two usable hosts instead of none?
RFC 3021 allows /31 prefixes on point-to-point links, where the two addresses are used by the routers at each end and no broadcast address is reserved. A /32 is a single host route. The calculator follows RFC 3021 rather than the older subtract-two rule for those two prefixes.