CIDR / Subnet Calculator
Understand CIDR / Subnet Calculator
Turns a CIDR block such as 192.168.1.0/24 into the network address, broadcast address, usable host range, subnet mask, and host count.
How it works
The prefix length after the slash is the number of leading bits that identify the network; the remaining bits address hosts. A /24 fixes 24 bits and leaves 8, so the mask is 255.255.255.0 and the block holds 2^8 = 256 addresses, of which 254 are usable once the network address (all host bits 0) and the broadcast address (all host bits 1) are removed. The general formula is 2^(32 − prefix) − 2. A /26 leaves 6 host bits: 64 addresses, 62 usable, mask 255.255.255.192, and the four /26 blocks inside a /24 start at .0, .64, .128, and .192. All of this is bitmasking on a 32-bit integer and runs locally in your browser.
When to use it
- Splitting a VPC or on-premises range into per-subnet blocks and checking that they do not overlap
- Working out whether a /27 is large enough for a subnet before allocating it (30 usable hosts, not 32)
- Translating a firewall or security-group rule written in mask form into CIDR form, or the reverse
- Confirming which network address a given host address belongs to — 192.168.1.100/26 is in the 192.168.1.64 network, not 192.168.1.0
Watch out for
- A /31 has no network or broadcast address in the classic sense. RFC 3021 makes both addresses usable so a point-to-point link does not waste half a block, and the tool reports 2 usable hosts rather than 0.
- Cloud providers reserve more than the two classic addresses. AWS takes five per subnet (network, VPC router, DNS, a reserved address, and broadcast), so a /24 gives 251 usable addresses on AWS, not 254.
- The "IP class" field is historical. Classful A/B/C addressing was superseded by CIDR in 1993 — the class shown is derived from the first octet and has no effect on the mask or the host count.
- A host address and a network address look identical. 10.0.5.37/16 is a host inside 10.0.0.0/16; the tool masks it down for you, but a config file that expects a network address will silently behave differently if you paste the host form.
Frequently Asked Questions
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation combines an IP address and prefix length in one expression: 10.0.0.0/8. The /8 means the first 8 bits are the network, leaving 24 bits for hosts (16,777,214 usable addresses). It replaced old Class A/B/C addressing.
How do I find how many hosts fit in a /24 subnet?
A /24 has 8 host bits: 2^8 = 256 total addresses minus 2 (network and broadcast) = 254 usable hosts. Formula: 2^(32-prefix) - 2. So /28 = 2^4 - 2 = 14 hosts; /22 = 2^10 - 2 = 1,022 hosts.
What subnets does AWS use for VPCs?
AWS supports VPC CIDR blocks from /16 to /28. Common patterns: /16 (65,534 IPs) for the VPC, /24 (254 IPs) per availability zone subnet. AWS reserves 5 IPs per subnet (network, router, DNS, future, broadcast), so a /24 gives 251 usable.
How to Use CIDR / Subnet Calculator
- Paste or type your input in the input area above.
- The tool processes your input automatically or click Run.
- Copy or download the result using the action buttons.
- Use Ctrl+Enter to run quickly from the keyboard.