CIDR Notation Explained: /24, /16 and /64 With Examples
A CIDR calculator turns address/prefix into a network number, a mask, and a count of addresses. CIDR notation is the slash: 10.0.0.0/24 means “the first 24 bits are fixed.” FlashKit’s IPv4 CIDR calculator does that arithmetic in the current tab for IPv4 prefixes 0–32. The slug mentions IPv6; the parser does not. IPv6 /64 counts below come from 2^(128−prefix), not from the widget. Step-by-step: work out the IP range from CIDR, or convert an IP range to CIDR.
The prefix is the number of fixed bits
An IPv4 address is 32 bits. A prefix of p means the first p bits identify the network; the remaining 32 − p bits identify hosts (or further subnets). Total addresses in the block = 2^(32−p). The dotted mask has 1s in those first p bits. FlashKit computes the mask as (-1) << (32 − prefix) then prints it dotted. Network = address AND mask. Broadcast = network OR NOT mask. Usable hosts on this page = total − 2, or 0 when that would be negative (/31 and /32). RFC 3021 (two usable addresses on a /31) is not implemented.
Run the IPv4 CIDR math in this tab
Address plus a /0–/32 slider. Network, mask, broadcast, usable hosts. IPv6 is not parsed.
Open the CIDR calculatorTable: /16, /24, /26, /28
Verified with Python ipaddress (num_addresses and netmask):
| Prefix | Host bits | Total IPs | FlashKit usable | Mask |
|---|---|---|---|---|
| /16 | 16 | 65,536 | 65,534 | 255.255.0.0 |
| /24 | 8 | 256 | 254 | 255.255.255.0 |
| /26 | 6 | 64 | 62 | 255.255.255.192 |
| /28 | 4 | 16 | 14 | 255.255.255.240 |
The default widget sample is 192.168.1.1/24 → network 192.168.1.0, mask 255.255.255.0, first 192.168.1.1, last 192.168.1.254, broadcast 192.168.1.255, total 256, usable 254. Drag the slider; there is no submit button.
Edges the slider will also show, matching the component: a /32 of 192.168.1.1 is total 1, usable 0 (the page always subtracts 2 and floors at 0). A /31 of 192.168.1.0 is total 2, usable 0 — RFC 3021 would call both addresses usable on a point-to-point link; this calculator does not. A /30 of 192.168.1.10 is network 192.168.1.8, usable 192.168.1.9 and .10, broadcast .11, mask 255.255.255.252. A /12 of 172.16.0.1 is network 172.16.0.0, mask 255.240.0.0, last usable 172.31.255.254 — that is 1,048,576 addresses (2^20), not a “small lab.” Invalid IPv4 (letters, five octets) is parsed as 0 and the cards stop updating until you fix the address. Octets above 255 still parse as integers in this widget and can produce surprising networks; prefer canonical 0–255 dotted quads.
Worked example: is 10.0.0.77 inside 10.0.0.64/26?
A /26 mask is 255.255.255.192, binary 11111111.11111111.11111111.11000000 — 26 ones, then 6 host bits. 10.0.0.77 in binary (last octet 77 = 64+8+4+1):
address 00001010 00000000 00000000 01001101 (10.0.0.77)
mask 11111111 11111111 11111111 11000000 (255.255.255.192)
AND 00001010 00000000 00000000 01000000 (10.0.0.64)
The network number is 10.0.0.64, which is exactly the block we named, so 10.0.0.77 ∈ 10.0.0.64/26. Python: IPv4Address('10.0.0.77') in IPv4Network('10.0.0.64/26') is True. Broadcast of that /26 is 10.0.0.127; usable on FlashKit is 10.0.0.65–10.0.0.126 (62 hosts). 10.0.0.63 is in the previous /26 (10.0.0.0/26), not this one.
Range → CIDR
The inclusive range 10.0.0.0–10.0.1.255 is 512 addresses, which is one prefix: 10.0.0.0/23. ipaddress.summarize_address_range returns exactly that block. An uneven range such as 10.0.0.10–10.0.0.40 cannot be one prefix; it splits into several (a /28, a /29, leftover /32s). The FlashKit slider does not invert a range into prefixes — you type an address and a prefix, not two ends. For mapped IPv6 spellings of a single IPv4 (not prefix math), use the IPv4 to IPv6 converter.
Worked split, so the “several blocks” claim is not a slogan. 10.0.0.10–10.0.0.40 is 31 addresses. In CIDR that is typically 10.0.0.10/31, 10.0.0.12/30, 10.0.0.16/28, 10.0.0.32/29, 10.0.0.40/32 (one valid covering). You would not type that into FlashKit; you would compute it with summarize_address_range or a range-to-CIDR tool that accepts two ends. Security-group authors who paste 10.0.0.10–10.0.0.40 as a single /27 (10.0.0.0/27 goes to .31) have opened extra addresses they did not intend.
IPv6: why /64 is the standard LAN
IPv6 addresses are 128 bits. A /64 leaves 64 host bits: 2^64 addresses (18,446,744,073,709,551,616). Stateless address autoconfiguration (SLAAC) is specified to run on a /64 link. A site is often delegated a /48 (16 bits of subnetting = 65,536 /64s) or a /56 (256 /64s). Host bits at /48 are 80 (2^80 addresses); at /56 they are 72 (2^72). RFC 3849 documentation prefix 2001:db8::/32 is the IPv6 analogue of 192.0.2.0/24 — use it in examples. FlashKit’s CIDR form will not parse 2001:db8::/64; a colon fails the IPv4 regex and the previous IPv4 result stays on screen. Do the /64 count on paper or in ipaddress, not in that slider. AWS also reserves the first four and last IPv6 addresses in a subnet (see the same VPC sizing page); a /64 is still enormous after that reservation.
Cloud usage: AWS reserved addresses
AWS VPC subnet sizing states that the first four IP addresses and the last IP address in each subnet CIDR are not available for your use. For 10.0.0.0/24 that is five addresses:
10.0.0.0— network10.0.0.1— VPC router10.0.0.2— DNS (base of VPC range plus two)10.0.0.3— reserved for future use10.0.0.255— broadcast (unused in a VPC, still reserved)
So a /24 that FlashKit calls 254 usable hosts is 251 usable for EC2 in a VPC. AWS IPv4 subnet sizes run from /28 to /16. Security-group rules take CIDR as the source; opening 10.0.0.0/16 is 65,536 addresses, not a single lab VM. Confirm in the console before you punch a hole.
A typical three-tier sketch, all RFC 1918, none of it pushed into AWS by this page: VPC 10.0.0.0/16; public subnet 10.0.0.0/24 (251 instance IPs after AWS’s five reservations); app subnet 10.0.1.0/24; data subnet 10.0.2.0/24. A security group that should accept only the app tier uses source 10.0.1.0/24, not 0.0.0.0/0 and not the whole VPC /16. If you are matching a single host, /32 is the IPv4 way; FlashKit will show usable 0 on that prefix because it subtracts 2. Copy the address into the SG as /32 anyway.
BYOIP on AWS is the documented exception where you may use the first and last addresses of a range you brought; the five-address reservation still applies to ordinary VPC CIDRs. Do not take a FlashKit “usable 254” number, subtract nothing, and expect 254 ENIs in a /24 subnet.
Read the widget cards against the formulas once so you trust them: for 10.0.0.77/26, network 10.0.0.64, mask 255.255.255.192, first 10.0.0.65, last 10.0.0.126, broadcast 10.0.0.127, total 64, usable 62. Type those into the slider (IP 10.0.0.77, prefix 26) and you should see the same numbers. That is the containment example from the binary AND, now in the UI. Application-level debugging of IP and DNS is in network troubleshooting for web developers. Mapped ::ffff: spellings are the IPv4 to IPv6 guide.
Check a /26 before you open the SG
Local IPv4 arithmetic. Not a live route table and not an AWS API.
Open the CIDR calculatorFrequently asked questions
What does a CIDR calculator compute?
From an IPv4 address and prefix, FlashKit prints network, subnet mask, first/last usable, broadcast, total count, and usable hosts (total − 2, or 0 for /31 and /32). It does not implement IPv6 prefix math.
How many IPs in a /24?
256 addresses (2^(32−24)). Classic usable hosts are 254 (minus network and broadcast). AWS reserves five addresses in a VPC subnet, so a /24 there has 251 usable for instances.
Is 10.0.0.77 inside 10.0.0.64/26?
Yes. The /26 mask is 255.255.255.192. 10.0.0.77 AND that mask is 10.0.0.64, which is the network number.
What is 10.0.0.0–10.0.1.255 in CIDR?
One block: 10.0.0.0/23 (512 addresses). Uneven ranges split into several prefixes; ipaddress.summarize_address_range lists them.
Why is IPv6 /64 the usual LAN size?
SLAAC expects a /64 on the link (2^64 addresses). Sites are often given a /48 or /56 to carve many /64s. That math is not in FlashKit’s IPv4 slider.