The fastest way to do IPv4 subnetting
This subnet calculator turns the tedious binary arithmetic of IPv4 subnetting into a single glance. Enter any IPv4 address and a CIDR prefix (or its dotted-decimal subnet mask), and the tool instantly returns the network address, broadcast address, the first and last usable host, the wildcard mask, the total and usable host counts, and the address class. Everything runs locally in your browser, so no IP address, hostname, or network plan ever leaves your machine — ideal for working on production infrastructure where confidentiality matters.
How IPv4 subnetting works
An IPv4 address is a 32-bit number, usually written as four 8-bit octets in dotted decimal (for example 192.168.1.10). A subnet mask splits those 32 bits into a network portion (the leading 1 bits) and a host portion (the trailing 0 bits). CIDR (Classless Inter-Domain Routing) notation writes the mask as a slash followed by the count of network bits, so /24 means the first 24 bits are network and the last 8 are host.
total addresses = 2 ^ (32 − prefix)
usable hosts = 2 ^ (32 − prefix) − 2 (for prefix ≤ 30)
network = IP AND mask
broadcast = network OR (NOT mask)
The network address is what you get when you keep the network bits and set every host bit to 0 (a bitwise AND of the IP and the mask). The broadcast address sets every host bit to 1 (a bitwise OR of the network and the inverted mask). Every address strictly between those two is a usable host address that you can assign to a device.
Worked example: 192.168.1.10 /26
A /26 mask is 255.255.255.192 — 26 network bits and 6 host bits, giving 2^6 = 64 addresses per subnet. The address 192.168.1.10 falls in the first block (192.168.1.0 – 192.168.1.63). So:
- Network: 192.168.1.0
- Broadcast: 192.168.1.63
- Usable range: 192.168.1.1 – 192.168.1.62 (62 hosts)
- Wildcard mask: 0.0.0.63
Change the prefix to /27 and each subnet shrinks to 32 addresses (30 usable); change it to /25 and it grows to 128 addresses (126 usable). The slider above lets you feel that trade-off in real time.
CIDR to subnet mask reference table
The most common prefixes and their dotted-decimal masks and host counts:
| CIDR | Subnet Mask | Wildcard | Total | Usable Hosts |
|---|---|---|---|---|
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1024 | 1022 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65536 | 65534 |
| /8 | 255.0.0.0 | 0.255.255.255 | 16777216 | 16777214 |
Common use cases
- Planning a LAN or VLAN: pick a prefix that fits your device count without wasting address space — a 50-device office fits in a /26 (62 usable).
- VLSM and supernetting: carve a large block into right-sized subnets, or aggregate routes to shrink routing tables.
- Firewall and ACL rules: read off the wildcard mask for Cisco ACLs, or the network/broadcast pair for allow-lists.
- Cloud VPCs: AWS, Azure, and GCP all use CIDR blocks for VPC and subnet sizing — this tool validates your /16 to /28 plans instantly.
- Studying for CCNA / Network+: check your manual subnetting answers and build intuition with the live slider.
/31 and /32 special cases
Per RFC 3021, a /31 subnet has just two addresses and both are usable as host addresses on point-to-point links — there is no separate network or broadcast address, which conserves scarce IPv4 space on router links. A /32 describes a single host (a host route), commonly seen on loopback interfaces and in routing tables. This calculator handles both correctly instead of reporting "0 usable hosts".
Why use a client-side subnet calculator?
Because subnet math involves the literal addressing of your infrastructure, sending it to a third-party server is an unnecessary risk. This tool computes everything with JavaScript in your browser — it works offline once loaded, returns answers with zero network latency, and never logs your inputs. It is part of the DevCalc hub of free, privacy-first developer calculators.