IPv4 subnet calculator: network, broadcast and usable range
- Address
- 192.168.10.77/26
- Network
- 192.168.10.64
- Broadcast
- 192.168.10.127
- Usable range
- 192.168.10.65 to 192.168.10.126
- Usable hosts
- 62
- Total addresses
- 64
- Netmask
- 255.255.255.192
- Wildcard (ACL)
- 0.0.0.63
- Mask in binary
- 11111111.11111111.11111111.11000000
- Class (historic)
- C
- Address type
- Private (RFC 1918)
Give the calculator an IPv4 address with a prefix length or a dotted netmask and it tells you which subnet that address belongs to: the network and broadcast addresses, the first and last address you can hand to a host, how many hosts fit, the mask in three notations and what kind of address it is. Two optional fields cut the block into smaller subnets or find the smallest prefix that holds a given number of hosts.
How it works
Everything is bit arithmetic on the address treated as one 32-bit number. The prefix length says how many leading bits belong to the network, and the mask is that many ones followed by zeros. A bitwise AND with the mask clears the host bits and leaves the network address. Setting every host bit to one gives the broadcast address. The wildcard is simply the mask with every bit flipped.
mask = 32 bits: prefix ones, then (32 - prefix) zeros
network = address AND mask
wildcard = NOT mask
broadcast = network OR wildcard
total = 2^(32 - prefix)
usable = total - 2 (/31: 2, /32: 1)
first host = network + 1 (/31 and /32: network)
last host = broadcast - 1 (/31 and /32: broadcast)
The two optional fields use the same numbers:
split count = 2^(new prefix - old prefix)
split step = 2^(32 - new prefix) addresses
smallest fit = longest prefix p where 2^(32 - p) - 2 >= hosts
(1 host returns /32, 2 hosts return /31)
The input takes 192.0.2.10/26 or an address and a mask separated by a space, such as 172.16.5.4 255.255.240.0, which reads as /20. The mask has to be contiguous, ones followed by zeros, so 255.0.255.0 is rejected, and so is a wildcard like 0.0.0.255 typed where the netmask belongs. The split table lists up to 64 subnets; the caption above it always gives the full count. Changing the prefix clears the split choice, since a split picked for one prefix means nothing for another.
Worked example: 192.168.10.77/26
The calculator opens with 192.168.10.77/26. A /26 leaves 6 host bits, so the block holds 2^6 = 64 addresses and the last octet of the mask is 11000000, which is 192. Only the last octet needs any work, because the first three are all network bits:
address 77 = 01001101
mask 192 = 11000000
AND = 01000000 = 64 -> network 192.168.10.64
host bits set = 01111111 = 127 -> broadcast 192.168.10.127
That gives the full output:
| Field | Value |
|---|---|
| Address | 192.168.10.77/26 |
| Network | 192.168.10.64 |
| Broadcast | 192.168.10.127 |
| Usable range | 192.168.10.65 to 192.168.10.126 |
| Usable hosts | 62 |
| Total addresses | 64 |
| Netmask | 255.255.255.192 |
| Wildcard (ACL) | 0.0.0.63 |
| Mask in binary | 11111111.11111111.11111111.11000000 |
| Class (historic) | C |
| Address type | Private (RFC 1918) |
Choose /28 in the split menu and you get four subnets of 16 addresses each: 192.168.10.64/28 (hosts .65 to .78, broadcast .79), 192.168.10.80/28, 192.168.10.96/28 and 192.168.10.112/28 (hosts .113 to .126, broadcast .127). Type 50 into the hosts field and the smallest fit is /26 with 62 usable, the block you already have. Type 63 and the answer moves to /25 with 126 usable, because 62 is the ceiling of a /26.
Limits and gotchas
- A /31 follows RFC 3021: two addresses, both usable, no network or broadcast address. It is meant for point-to-point links. The calculator shows the broadcast as "none (point-to-point or host route)" and counts 2 usable hosts. Both ends of the link have to support it, so check before you renumber a router link.
- The hosts field answers 2 with "/31 (2 usable, point-to-point links only)". That is right for a router-to-router link, but on an ordinary LAN segment, where hosts still expect a broadcast address, plan a /30 instead (also 2 usable). One host returns "/32 (single host)", which is a loopback or a host route, not a LAN.
- Usable does not mean free. The default gateway takes one address, a redundant gateway pair takes three (two routers and the shared virtual address), and switches, printers and DHCP reservations take more. Size a VLAN for the devices you have plus room to grow, the way the home VLAN plan does.
- The class line is history. Classful addressing ended with CIDR in 1993, and the line is there because exam questions and old documentation still use it. 192.168.10.77 is class C by its first octet, yet a /26 inside it is perfectly normal, and so is 192.168.0.0/16.
- The address type comes from a list of special ranges: 0.0.0.0/8 (this network, not routable), RFC 1918 private space, the RFC 6598 shared block 100.64.0.0/10, loopback, link-local 169.254.0.0/16, the 192.0.0.0/24 IETF protocol assignments, the 198.18.0.0/15 benchmarking range, the three RFC 5737 documentation blocks, multicast and the reserved 240.0.0.0/4. Anything else is labeled Public.
- Host bits in the input are fine. You can type any address inside the block; that is the point of the tool. Router configuration is stricter: an interface wants a host address and mask, a static route wants the network address and mask, and an OSPF
networkstatement wants the network address with the wildcard. - IPv4 only. IPv6 subnetting works on 128 bits and has no broadcast address, so it needs different arithmetic.
Write the result down where the next person will find it. A subnet that lives only in someone's head is how two VLANs end up sharing 192.168.10.0/24; the IPAM and diagrams guide covers a simple way to keep track, and the hosts guide shows how the same ranges scope discovery in a monitor.
Questions
How many usable hosts are in a /24?
- A /24 holds 256 addresses. The network address (.0) and the broadcast address (.255) cannot be assigned to a host, which leaves .1 to .254.
Why does a /31 show two usable hosts?
RFC 3021 allows 31-bit prefixes on point-to-point links. With only two devices on the link there is no need for a network or broadcast address, so both addresses go to the two ends. It saves half the space a /30 would use on every router link.
What is a wildcard mask?
It is the netmask with every bit flipped: 255.255.255.192 becomes 0.0.0.63. Cisco-style access lists and OSPF network statements use it, where a 0 bit means "must match" and a 1 bit means "any value".
Can I type a netmask instead of a prefix length?
Yes. Type the address, a space and the mask, for example 172.16.5.4 255.255.240.0, and the calculator reads it as /20. The mask must be contiguous: ones first, then zeros.
How do I split a /24 into four subnets?
Enter the /24 and choose /26 in the split menu. Each /26 has 64 addresses and 62 usable hosts, starting at .0, .64, .128 and .192.