Subnet Calculator
Enter an IPv4 address plus a CIDR prefix or subnet mask to get the network address, broadcast address, usable host range, and more — instantly, no signup. Also works as a subnet mask calculator, subnet calc, and subnet mask cheat sheet.
Calculate a subnet
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation writes an IP address together with the number of bits
used for the network portion, e.g. 192.168.1.0/24. The /24 means the first
24 bits are the network prefix, leaving 8 bits (256 addresses) for hosts on that subnet — 254 of them
usable once you subtract the network and broadcast addresses.
Worked examples
192.168.1.10/24 — a common home/small-office network: network address
192.168.1.0, broadcast 192.168.1.255, mask 255.255.255.0,
usable host range 192.168.1.1–192.168.1.254 (254 usable addresses out
of 256 total).
10.0.5.130/26 — a smaller subnet carved out of a larger private range: network address
10.0.5.128, broadcast 10.0.5.191, mask 255.255.255.192,
usable host range 10.0.5.129–10.0.5.190 (62 usable out of 64 total).
Note the input address (.130) doesn't have to be the network address itself — the
calculator finds which /26 block it falls into.
Subnet cheat sheet: common prefix lengths
This subnet mask cheat sheet covers the prefix lengths you'll hit most often — bookmark it as a quick reference instead of recalculating usable hosts by hand every time.
| /24 — 255.255.255.0 | 254 usable hosts |
| /25 — 255.255.255.128 | 126 usable hosts |
| /26 — 255.255.255.192 | 62 usable hosts |
| /27 — 255.255.255.224 | 30 usable hosts |
| /28 — 255.255.255.240 | 14 usable hosts |
| /29 — 255.255.255.248 | 6 usable hosts |
| /30 — 255.255.255.252 | 2 usable hosts |
| /31 — 255.255.255.254 (RFC 3021) | 2 usable (point-to-point link) |
| /32 — 255.255.255.255 | 1 (single host route) |
Frequently asked questions
Why subtract 2 from the total address count to get usable hosts?
The first address in a subnet is the network address (identifies the subnet itself) and the last is the broadcast address (sends to every host on it) — neither can be assigned to a device. The exceptions are /31 (a 2-address point-to-point link where RFC 3021 allows both addresses to be used) and /32 (a single address with no network/broadcast distinction at all).
What's the difference between a subnet mask and a wildcard mask?
A subnet mask marks network bits with 1s and host bits with 0s (e.g. 255.255.255.0). A
wildcard mask is its exact inverse (0.0.0.255) — Cisco ACLs and OSPF configuration use
wildcard masks instead of subnet masks, which is a common source of off-by-one mistakes if you
paste the wrong one in.
What are the private (RFC 1918) IP ranges?
10.0.0.0/8 (10.0.0.0–10.255.255.255), 172.16.0.0/12
(172.16.0.0–172.31.255.255), and 192.168.0.0/16 (192.168.0.0–192.168.255.255)
— these are reserved for private networks and never routed on the public internet. This calculator
flags whether an address you enter falls in one of them.
Do IP address classes (A/B/C) still matter?
Not for routing — classful addressing was replaced by CIDR in the 1990s, so a /24 network starting with 192 isn't restricted to being a "Class C" network the way it once was. The class is shown here mainly as a historical reference, since some older documentation and certification exams still use the terminology.