Free IPv4 subnet calculator
Enter an IPv4 address and a CIDR prefix and this IP subnet calculator returns the network address, broadcast address, usable host range, host count, subnet mask, and wildcard mask — for any prefix from /0 to /32, updated live, as you type.
On this page14 sections
IPv4 subnetting only. IPv6 subnets have different addressing rules.
Results are estimates. Consult a professional.
What the IP subnet calculator does
An IP subnet calculator takes an IPv4 address and a CIDR prefix — like 192.168.1.10/24 — and works out everything that prefix implies: the network address, the broadcast address, the usable host range, how many hosts fit, the subnet mask, and the wildcard mask. Subnetting is the act of carving one block of IP addresses into smaller, self-contained networks, and the prefix is the dial that controls how big each piece is.
The tool above runs the math live as you type. Enter an address and a prefix between /0 and /32, and it reports the network (the first address, which names the subnet), the broadcast (the last address), the first and last usable host, the dotted subnet mask and wildcard, and both the total and usable host counts. Nothing is sent to a server — the bit arithmetic happens on your device.
How CIDR notation works
An IPv4 address is 32 bits, usually written as four dotted decimals (each an 8-bit "octet"). CIDR — Classless Inter-Domain Routing — splits those 32 bits into a network part and a host part. The slash number is the prefix length: it counts how many leading bits belong to the network. In /24, the first 24 bits are the network and the last 8 are free for hosts; in /26, 26 bits are network and only 6 are left for hosts.
The prefix is just a compact way of writing the subnet mask — a 32-bit pattern of 1-bits (network) followed by 0-bits (host). A /24 mask is twenty-four 1s then eight 0s, which in dotted decimal is 255.255.255.0. The wildcard mask is the bitwise inverse — the 0s and 1s flipped — so a /24 wildcard is 0.0.0.255. The network address is the IP with every host bit set to 0; the broadcast is the IP with every host bit set to 1.
How to use the subnet calculator
You only need two things: an IPv4 address and a prefix. The prefix can come from CIDR notation you already have, or you can pick one to fit a target number of hosts.
- Enter the IPv4 address. Any address inside the subnet works — you don't need the network address itself. The calculator finds the network for you, so
192.168.1.10and192.168.1.200both resolve to the same/24network. - Set the CIDR prefix (0–32). Smaller numbers mean bigger subnets:
/24gives 254 usable hosts,/26gives 62,/30gives 2. - Read the results. Network and broadcast bracket the subnet; first and last host give the assignable range; the subnet mask and wildcard are ready to paste into router, firewall, or DHCP config.
If you know the subnet mask but not the prefix, convert it: count the 1-bits. 255.255.255.0 is 8 + 8 + 8 + 0 = 24, so it is /24; 255.255.255.192 is 8 + 8 + 8 + 2 = 26, so it is /26. The prefix and the mask are two notations for the same thing.
CIDR prefix, subnet mask, and host count table
This is the table most people come here for: each common prefix, its dotted subnet mask, the total addresses in the block, and how many are usable for hosts. Every step down the table halves the subnet — one more network bit, one fewer host bit.
| CIDR | Subnet mask | Wildcard | Total addresses | Usable hosts |
|---|---|---|---|---|
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 0 (2 point-to-point) |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 0 (single host) |
Usable hosts = total − 2 (network + broadcast), except /31 and /32 — see the special cases below. Total addresses = 2^(32 − prefix). Values follow RFC 4632 (CIDR) and RFC 3021 (/31).
The pattern repeats above /24 too. A /16 (255.255.0.0) holds 65,536 addresses with 65,534 usable; a /8 (255.0.0.0) holds 16,777,216 with 16,777,214 usable. Each bit you give back to the network quarters, eighths, and so on the host space.
A worked subnet example: 192.168.1.10/24
Take the calculator's default, 192.168.1.10/24. We'll find the network, broadcast, host range, and counts by hand, then confirm them against the tool.
Step 1 — Split network from host bits
A /24 mask is 255.255.255.0: the first three octets are network, the last octet is host. So the network part is 192.168.1 and the host part is the final .10.
Step 2 — Find the network and broadcast
Set every host bit to 0 for the network: 192.168.1.0. Set every host bit to 1 for the broadcast: 192.168.1.255. These two addresses bracket the subnet and can't be given to a device.
Step 3 — Count the hosts and read the range
The block holds 2^8 = 256 addresses. Subtract the network and broadcast for 254 usable hosts, running from 192.168.1.1 to 192.168.1.254.
Now tighten it to a /26
Change the prefix to /26 and the mask becomes 255.255.255.192. Now 26 bits are network and 6 are host, so the block is 2^6 = 64 addresses. 192.168.1.10 still falls in the first sub-block, whose network is 192.168.1.0 and broadcast is 192.168.1.63 — giving 62 usable hosts from 192.168.1.1 to 192.168.1.62. The same /24 space now splits into four equal /26 subnets (.0, .64, .128, .192).
Network vs broadcast vs usable hosts
Every subnet reserves its first and last address for special roles, which is why the usable count is always two short of the total. Understanding the three roles is the difference between a working network and a subtle misconfiguration.
- Network address (first address). All host bits 0. It names the subnet itself — it's what appears in routing tables — and is never assigned to a device.
- Broadcast address (last address). All host bits 1. A packet sent here reaches every host on the subnet at once. It can't be a device's own address.
- Usable host addresses (everything between). These are the addresses you actually assign to computers, phones, printers, and router interfaces. For a
/24that's the 254 addresses from.1to.254.
Private ranges and the /31 and /32 special cases
Most subnets you'll calculate sit inside the private address ranges set aside by RFC 1918 — the addresses that never route on the public internet and that home and office networks use freely behind NAT.
| Private block | CIDR | Address range | Typical use |
|---|---|---|---|
| 10.0.0.0/8 | /8 | 10.0.0.0 – 10.255.255.255 | Large enterprise networks |
| 172.16.0.0/12 | /12 | 172.16.0.0 – 172.31.255.255 | Mid-size networks, many cloud VPCs |
| 192.168.0.0/16 | /16 | 192.168.0.0 – 192.168.255.255 | Home and small-office LANs |
The three RFC 1918 private IPv4 ranges. Addresses inside them are non-routable on the public internet and reusable on any private network.
Two prefixes break the usual "− 2" rule, and the calculator handles both:
- /31 — two addresses, both usable. On a point-to-point link there's no need for a broadcast address, so RFC 3021 lets a
/31assign both of its two addresses to the two ends. The calculator marks 0 "usable" under the classic rule but the block still works for a router-to-router link. - /32 — a single host. The mask
255.255.255.255matches exactly one address. It's used for loopbacks, host routes, and firewall rules that target one machine — a network of one.
Use cases and common subnetting mistakes
Subnet math shows up anywhere addresses are allocated or filtered. A few jobs come up constantly:
- Network design. Right-size each subnet to the number of devices it holds, so you don't waste a /24 on a link that needs four addresses.
- Firewall and ACL rules. Express "this whole subnet" as a single CIDR block instead of listing every address — and use the wildcard mask in routers (Cisco ACLs) that expect it instead of a subnet mask.
- VLANs and segmentation. Map each VLAN to its own subnet to keep broadcast domains small and traffic isolated.
- Cloud VPCs. Plan non-overlapping CIDR blocks before you launch, because resizing a live VPC subnet is painful.
And the mistakes that bite most often:
- Forgetting the − 2. A /29 has 8 addresses but only 6 usable hosts. Plan for the usable count, not the total.
- Off-by-one on the prefix. A /25 is not "half a /24 minus a bit" — it's exactly 128 addresses, 126 usable. Each bit halves the block, so a single-digit slip quarters or doubles your space.
- Assigning the network or broadcast address. Handing
.0or.255(on a /24) to a device causes hard-to-trace failures. - Overlapping subnets. Two blocks that share addresses break routing — always confirm new subnets don't collide with existing ones.
IP subnet definitions
How accurate is this subnet calculator?
The math is exact. Network, broadcast, mask, wildcard, and host counts are computed with the same bitwise operations defined in the CIDR standard, so the calculator agrees digit for digit with any correct subnet tool. There's no rounding and no estimate — a /24 always resolves to 256 total and 254 usable addresses.
This tool covers IPv4 only. IPv6 follows the same prefix principle but in a vastly larger 128-bit space, where subnets are typically /48, /56, or /64. For related transfer math, see our bandwidth calculator and download time calculator.
Address and prefix arithmetic follows RFC 4632 (CIDR) and RFC 950 (subnetting); private ranges follow RFC 1918.Frequently asked questions about the free IPv4 subnet calculator
About this IP subnet calculator
This IPv4 subnet calculator runs entirely in your browser. The address and prefix you enter are never stored, logged, or sent to any server — the network, broadcast, host range, subnet mask, and wildcard are computed locally with plain bit arithmetic, so the tool works the same offline.
It is one of our free developer tools. Browse the full set on the all calculators page.