Find the network and broadcast address, subnet mask, host range and usable host count for any IPv4 subnet, and plan unequal subnets with VLSM.
Usable hosts exclude the network and broadcast addresses, except at /31 and /32 where RFC 3021 makes every address a host.
| Prefix | Subnet mask | Addresses | Usable hosts |
|---|---|---|---|
| /0 | 0.0.0.0 | 4,294,967,296 | 4,294,967,294 |
| /1 | 128.0.0.0 | 2,147,483,648 | 2,147,483,646 |
| /2 | 192.0.0.0 | 1,073,741,824 | 1,073,741,822 |
| /3 | 224.0.0.0 | 536,870,912 | 536,870,910 |
| /4 | 240.0.0.0 | 268,435,456 | 268,435,454 |
| /5 | 248.0.0.0 | 134,217,728 | 134,217,726 |
| /6 | 252.0.0.0 | 67,108,864 | 67,108,862 |
| /7 | 254.0.0.0 | 33,554,432 | 33,554,430 |
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /9 | 255.128.0.0 | 8,388,608 | 8,388,606 |
| /10 | 255.192.0.0 | 4,194,304 | 4,194,302 |
| /11 | 255.224.0.0 | 2,097,152 | 2,097,150 |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 |
| /13 | 255.248.0.0 | 524,288 | 524,286 |
| /14 | 255.252.0.0 | 262,144 | 262,142 |
| /15 | 255.254.0.0 | 131,072 | 131,070 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /17 | 255.255.128.0 | 32,768 | 32,766 |
| /18 | 255.255.192.0 | 16,384 | 16,382 |
| /19 | 255.255.224.0 | 8,192 | 8,190 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 512 | 510 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | 2 |
| /32 | 255.255.255.255 | 1 | 1 |
From the IANA IPv4 Special-Purpose Address Registry. "Globally reachable" is IANA's own column, and it is the honest replacement for a private/public flag — 127.0.0.1 is reserved, but it is loopback, not private use.
| Block | Purpose | Defined by | Globally reachable |
|---|---|---|---|
| 0.0.0.0/32 | "This host on this network" | RFC 1122 | No |
| 0.0.0.0/8 | "This network" | RFC 791 | No |
| 10.0.0.0/8 | Private use | RFC 1918 | No |
| 100.64.0.0/10 | Shared address space (carrier-grade NAT) | RFC 6598 | No |
| 127.0.0.0/8 | Loopback | RFC 1122 | No |
| 169.254.0.0/16 | Link local | RFC 3927 | No |
| 172.16.0.0/12 | Private use | RFC 1918 | No |
| 192.0.0.0/24 | IETF protocol assignments | RFC 6890 | No |
| 192.0.2.0/24 | Documentation (TEST-NET) | RFC 5737 | No |
| 192.31.196.0/24 | AS112-v4 | RFC 7535 | Yes |
| 192.52.193.0/24 | AMT relay | RFC 7450 | Yes |
| 192.88.99.0/24 | Deprecated 6to4 relay anycast | RFC 7526 | No |
| 192.168.0.0/16 | Private use | RFC 1918 | No |
| 192.175.48.0/24 | Direct delegation AS112 service | RFC 7534 | Yes |
| 198.18.0.0/15 | Benchmarking | RFC 2544 | No |
| 198.51.100.0/24 | Documentation (TEST-NET) | RFC 5737 | No |
| 203.0.113.0/24 | Documentation (TEST-NET) | RFC 5737 | No |
| 224.0.0.0/4 | Multicast | RFC 5771 | No |
| 240.0.0.0/4 | Reserved | RFC 1112 | No |
| 255.255.255.255/32 | Limited broadcast | RFC 8190 | No |
You might also find these calculators useful
Enter an IPv4 address and a prefix — or paste a block like 192.168.1.0/24 — and this calculator returns the network and broadcast addresses, the subnet mask and its wildcard, the usable host range and the host count, plus the same address written as an integer, in hexadecimal, in binary, as a reverse-DNS name and as an IPv6 mapping. Switch to VLSM mode to divide a network into subnets of different sizes.
An IPv4 address is 32 bits. A prefix length says how many of those bits identify the network, leaving the rest to identify hosts inside it. Bitwise-ANDing the address with the mask gives the network address; setting every host bit gives the broadcast address. Everything between them is available to hosts — with one exception worth knowing: RFC 3021 makes both addresses of a 31-bit prefix usable, because a point-to-point link has no broadcast to reserve.
Usable hosts in a subnet
Turn "about 40 devices" into a prefix: a /26 gives 62 usable hosts, a /27 only 30. The reference table makes the next size up obvious.
Divide one /24 into subnets for staff, printers, cameras and guest wifi, each sized to its own requirement rather than all four the same.
Work out exactly which addresses 10.20.0.0/18 covers before you write a rule that permits it — or before you trust one somebody else wrote.
A link between two routers needs two addresses. A /30 spends four to deliver two; a /31 delivers the same two from a block half the size.
Giving every site a /16 wastes 65,534 addresses on a twelve-person office. Sizing each subnet to its host count is how a private range lasts.
Every host in a subnet sees its broadcast traffic. Splitting a flat network into smaller subnets keeps that noise local instead of letting it reach every device.
Firewall rules, access lists and routing policy are written against subnets. A subnet per function gives you somewhere to attach a rule.
Contiguous subnets can be summarised into one advertised route, so neighbouring routers carry one entry instead of sixteen.
254. A /24 holds 256 addresses; the first is the network address and the last is the broadcast address, so 254 are left for hosts. The same subtraction applies from /0 through /30 — the reference table on this page lists every prefix.
Because there is nothing to reserve. RFC 3021 states that on a 31-bit prefix the two addresses "MUST be interpreted as host addresses", since a point-to-point link has no broadcast. Subtracting two would leave a link with no addresses at all, which is why /31 is the exception to the usual rule.
No — it is loopback, reserved by RFC 1122, and that is a different thing. Private-use space is 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 under RFC 1918: addresses you can assign to real hosts that simply are not routed on the public internet. A loopback address never leaves the machine. This calculator reports the reserved range by name rather than collapsing everything into private-or-public.
This page answers questions about one network: what is in it, and how do I divide it. A CIDR calculator answers questions about how blocks compose — converting notation to an address range, decomposing an arbitrary range into aligned blocks, and aggregating several blocks into one supernet. Both use the same arithmetic; they differ in what you start with and what you want back.
Variable-length subnet masking: giving each subnet the mask its own host count needs instead of one mask for all of them. A site with a 50-host floor, a 25-host floor and a two-address router link uses a /26, a /27 and a /31 rather than three /26s. Allocate the largest requirement first — a block has to start on a multiple of its own size, so placing a small subnet early can strand the alignment a larger one needs.
The subnet mask with every bit inverted, so 255.255.255.0 becomes 0.0.0.255. Cisco access lists and OSPF area statements take a wildcard mask where other tools take a subnet mask, and writing one where the other is expected is a common and quiet mistake. This calculator shows both.