How Do You Calculate a Subnet from a CIDR Block?
Updated 2026-06-27
To calculate a subnet from a CIDR block, split the prefix from the address: the number after the slash (the prefix length) tells you how many leading bits are the network, and the remaining bits are hosts. From a block like 192.168.1.0/24 you can derive the network address, broadcast address, netmask, wildcard mask, the first and last usable host, and exactly how many hosts fit. The fastest way to do all of that at once is the IPv4 Subnet & CIDR Calculator, which computes every value the moment you type.
What CIDR Notation Means
CIDR (Classless Inter-Domain Routing) notation writes an address as an IP plus a prefix length, like 10.0.0.0/8. The prefix is the count of network bits:
- /24 means 24 network bits, leaving 8 host bits — a 255.255.255.0 mask and 256 total addresses.
- /30 leaves 2 host bits — 4 addresses, 2 of them usable, common for point-to-point links.
- /16 leaves 16 host bits — 65,536 addresses.
The netmask marks the network bits as 1s; the wildcard mask is its exact inverse (0.0.0.255 for a /24) and is what Cisco ACLs and OSPF expect.
How to Calculate It Step by Step
Using the IPv4 Subnet & CIDR Calculator, the process is:
- Enter the block — type 192.168.1.0/24. You can also paste a bare IP (it defaults to /32) or use an explicit netmask like 10.0.0.0/255.0.0.0.
- Read the network and broadcast — the network is the lowest address in the block; the broadcast is the highest. Hosts live between them.
- Find the usable range — for most blocks the first usable host is network + 1 and the last is broadcast - 1. The tool shows the usable and total host counts so you do not have to compute 2 to the power of anything by hand.
- Re-mask quickly — click the /8, /16, /24 or /30 chips to keep the same address but change the prefix and see how the ranges shift.
Edge Cases Worth Knowing
Two prefixes behave specially, and the calculator handles both correctly:
- /31 follows RFC 3021 for point-to-point links — both addresses are usable, with no network or broadcast reserved, so you get 2 usable hosts.
- /32 is a single host, where the network, first host and last host are all the same address.
The tool also flags whether the block is private (RFC 1918) — the 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 ranges — or public, and reports the classful class (A through E) for reference.
Listing and Sharing Results
Need every address, not just the boundaries? Click List all addresses to expand the block into a copy-ready list (capped at 65,536 entries so the page stays fast), then use Copy all. Because the block you enter is written into the page URL, you can share a calculation just by copying the link.
Everything happens with plain bit-arithmetic in your browser — no IP address you enter is uploaded, stored or logged, which makes it safe for internal and production addressing. If you later need to convert that same address between decimal, hex, and binary, reach for the IP Address Converter. Together they cover most day-to-day IPv4 planning without ever touching a terminal.