An IP subnet calculator takes any IPv4 address and its subnet size and works out everything about the network it belongs to: where the network starts, where it ends, which addresses in between can be given to devices, and how many there are. Subnetting questions come up every time a network is planned, a router is configured or an exam asks how many hosts fit in a /26 — and by hand they mean binary arithmetic that is easy to get wrong.
This calculator does the whole job from a single address. Type an IPv4 address, give the subnet size either as a CIDR prefix (the /24 part) or as a dotted subnet mask (255.255.255.0), and you get the network address, broadcast address, usable host range and counts, the wildcard mask, the binary forms, and the address’s class and type. Everything runs in your browser — no address you type is sent anywhere.

What a subnet calculator works out
A subnet is a slice of the IPv4 address space. Every address in the slice shares the same opening bits, called the network part; the remaining bits vary from device to device and are called the host part. The subnet mask separates the two: a 1 bit marks a network bit, a 0 bit marks a host bit.
From one address and one mask, the calculator derives the full picture:
- Network address — the first address of the subnet (all host bits 0). It names the network itself and cannot be assigned to a device.
- Broadcast address — the last address (all host bits 1). Traffic sent here goes to every device on the subnet.
- First and last usable host — the addresses just inside those boundaries: the range you can actually hand out.
- Total and usable addresses — the size of the whole slice, and how much remains once the network and broadcast addresses are reserved.
- Wildcard mask — the mask flipped bit for bit, used in router access lists.
- Class and type — the historical class (A to E) and whether the address is private, public, loopback or reserved.
How to use this IP subnet calculator
- Type the IPv4 address. You can include the prefix, like 192.168.1.10/24, and the rest fills itself in.
- Set the subnet size in whichever form you have: the CIDR prefix box or the subnet mask box. Editing one updates the other.
- Press Calculate Subnet.
- Read the results table: network, broadcast, usable range and counts, with the binary forms underneath the main addresses.
- Change the prefix and calculate again to compare sizes — watching a /24 shrink to a /26 builds an instinct for subnet sizes fast.
Worked example: 192.168.1.10/24
Take the most common home-network address there is. The /24 means the first 24 bits are the network part, so the mask is 255.255.255.0 and only the last octet varies.
- Network address: the last octet drops to 0 → 192.168.1.0
- Broadcast address: the last octet fills to 255 → 192.168.1.255
- Usable range: everything between → 192.168.1.1 to 192.168.1.254
- Total addresses: 2^(32−24) = 2^8 = 256
- Usable hosts: 256 minus the network and broadcast addresses = 254
- Wildcard mask: the mask inverted → 0.0.0.255
In binary, the address is 11000000.10101000.00000001.00001010 and the mask is 11111111.11111111.11111111.00000000 — the mask's 1s cover exactly the first three octets, which is why those octets stay fixed across the subnet. The address is class C and private, part of the 192.168.0.0/16 block reserved for home and office networks.
CIDR notation, explained simply
CIDR (Classless Inter-Domain Routing) notation is the /24 style shorthand. The number after the slash counts how many of the 32 bits are network bits. A /24 keeps 24 network bits and leaves 8 host bits, so it holds 2^8 = 256 addresses. A /16 leaves 16 host bits and holds 65,536. Each step up in the prefix halves the subnet; each step down doubles it.
CIDR replaced the old class system because it lets a network be exactly the size it needs to be: a point-to-point link needs two addresses, not a whole class C block, and a /30 or /31 gives it exactly that. The calculator still reports the historical class for reference, but the prefix decides the size.
The full subnet cheat sheet: /0 to /32
The most-asked question — how many IPs in a /24 — is in the table: 256 total, 254 usable. The pattern is always total = 2^(32 − prefix), usable = total − 2, and the usable column follows it except for /31 and /32, explained below.
| Prefix | Subnet mask | Total 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 |
Private, public and special addresses
- Private (RFC 1918): 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 — used inside homes, offices and cloud networks, and translated to a public address by NAT at the edge. Most addresses people subnet by hand are in these blocks.
- Public: everything routable on the open internet that is not reserved for something else.
- Loopback: 127.0.0.0/8, including the famous 127.0.0.1 — traffic to these never leaves the device.
- Link-local: 169.254.0.0/16, the self-assigned addresses a device picks when DHCP fails.
- Multicast and reserved: 224.0.0.0/4 for multicast groups, 240.0.0.0/4 reserved for future use, and the documentation ranges (192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24) set aside for examples — which is why this article uses them.
Splitting a network: one /24 becomes four /26s
Subnetting usually means cutting a block into smaller pieces. Start with 192.168.1.0/24 and borrow two more bits (a /26): you get four subnets of 64 addresses each — 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26 and 192.168.1.192/26. Each has its own network and broadcast address (.0/.63, .64/.127, .128/.191, .192/.255) and 62 usable hosts. Run any of them through the calculator to check the boundaries — the second subnet trips people up most, because its network address (.64) looks like a host address in the parent /24.
The special cases: /31 and /32
Two prefixes break the "minus 2" rule, and this calculator handles both the way real networks do.
A /31 has only two addresses, so reserving one for the network and one for broadcast would leave nothing. RFC 3021 solves this for point-to-point links: on a link with exactly two ends, both addresses are usable, so a /31 shows 2 usable hosts.
A /32 is a single address — a host route. The network address, the only host and the broadcast are all the same address. /32s appear as loopback addresses on routers and in routes that point at one exact machine.
At the other extreme, a /0 covers all 4,294,967,296 IPv4 addresses. It is never assigned to a segment; it exists as the default route, 0.0.0.0/0 — the entry that matches everything.
What about IPv6?
This calculator is IPv4 only. IPv6 subnetting is a different discipline — 128-bit addresses, /64 as the standard subnet size, no broadcast address — and deserves its own tool rather than a cramped extra mode. IPv6 support is planned as a separate phase.
FAQs
What is an IP subnet calculator?
An IP subnet calculator takes an IPv4 address and a subnet size and works out the full details of that subnet: network address, broadcast address, first and last usable host, total addresses and usable hosts. Administrators use it when planning address ranges, configuring routers and checking that two networks do not overlap.
How many usable hosts are in a /24?
A /24 has 256 total addresses and 254 usable hosts. The first address (the network address) and the last (the broadcast address) are reserved, so 256 − 2 = 254 addresses can be given to devices. The same minus-2 rule applies to every normal subnet size from /0 to /30.
Why does a subnet have 2 fewer usable addresses than the total?
Because the first and last addresses do special jobs. The all-zeros host part is the network address, which identifies the subnet itself in routing tables. The all-ones host part is the broadcast address, which delivers traffic to every device on the subnet at once. Neither can be assigned to a device — except on /31 links and /32 host routes.
What is CIDR notation?
CIDR notation writes a subnet as an address plus a slash and a number, like 192.168.1.0/24. The number counts the network bits — how many of the 32 bits are fixed for the whole subnet. The rest are host bits, so the size is 2 raised to the power of (32 minus the prefix): a /24 has 8 host bits and 256 addresses; a /30 has 2 and 4.
What does a /31 subnet mean?
A /31 has just two addresses. Under the normal rules both would be reserved and nothing would be usable, but RFC 3021 allows both addresses on a point-to-point link to be used by the two devices at its ends, since a two-device link does not need a broadcast address. This calculator follows RFC 3021 and shows 2 usable hosts for a /31.
What is the difference between a network address and a broadcast address?
The network address is the first address in a subnet, with all host bits set to 0; it names the subnet itself and appears in routing tables. The broadcast address is the last address, with all host bits set to 1; packets sent to it reach every host on the subnet. For 192.168.1.0/24 they are 192.168.1.0 and 192.168.1.255.
Is 192.168.1.1 a private IP address?
Yes. 192.168.1.1 sits inside 192.168.0.0/16, one of the three private ranges defined by RFC 1918 (the others are 10.0.0.0/8 and 172.16.0.0/12). Private addresses are used inside home and office networks and are never routed on the public internet, which is why millions of networks can all use 192.168.1.1 at once without conflict.
Does this calculator work for IPv6?
No — this calculator covers IPv4 only. IPv6 uses 128-bit addresses, has no broadcast address, and treats /64 as the standard subnet size, so it needs a different calculator rather than an extra mode on this one. IPv6 support is planned as a separate tool.
