CIDR and Subnet Calculator
Network, broadcast, usable range and host count.
Everything is processed in this tab. Nothing you paste is sent anywhere.
Every tool runs entirely in your browser. Your files are never uploaded to a server.
A CIDR prefix says how many leading bits are the network. In 192.168.1.0/24 the first 24 bits are fixed, leaving 256 addresses — 254 usable, since the first is the network and the last is broadcast.
How to use Subnet Calculator
- Paste your CIDR blocks. One per line. A host address inside the block works too.
- Read the derived values. Network, netmask, wildcard, broadcast, usable range and counts.
About calculating a subnet
CIDR notation replaced the old class-based address system and is a good deal simpler than what it replaced: the number after the slash is how many leading bits identify the network, and everything remaining identifies a host within it. A /24 fixes 24 bits and leaves 8, giving 256 addresses. Each bit given back to the host portion doubles the block. Two conventions cause most of the arithmetic errors. The first is the two reserved addresses — the lowest in a block names the network and the highest is the broadcast address — which is why a /24 offers 254 usable hosts rather than 256. The second is that this convention does not apply at the very small end. RFC 3021 defines /31 blocks for point-to-point links, where both addresses are assignable because a link between exactly two devices has no use for a broadcast address, and a /32 is a single host. A calculator that subtracts two unconditionally reports zero or minus one usable hosts for these, which is a common and visible bug. There is also an implementation trap specific to JavaScript worth knowing if you ever write this yourself. Bitwise operators coerce to signed 32-bit integers, so any address in the upper half of the space — anything from 128.0.0.0 up — comes out negative, and every value derived from it is wrong. The unsigned right shift by zero is what forces the result back into the unsigned range, and it has to be applied to each intermediate value rather than only at the end.
Frequently asked questions
Why are there two fewer usable hosts than addresses?
Does that apply to a /31?
What is a wildcard mask?
How do I choose a prefix length?
Which ranges are private?
Last updated