IPv4 Subnet Calculator
Enter any IPv4 address with a prefix or mask to get the network, broadcast, usable host range, wildcard mask and host count - including correct /31 and /32 handling.
Result
Details
- Given address
- 192.168.10.0
- CIDR notation
- 192.168.10.0/26
- Mask (binary)
- 11111111.11111111.11111111.11000000
- Network (binary)
- 11000000.10101000.00001010.00000000
- Host bits
- 6 bits
- Integer (network)
- 3232238080
- Hex (network)
- 0xC0A80A00
About IPv4 Subnet Calculator
A subnet calculator turns an IPv4 address and prefix length into everything a router derives from it: the network address, the broadcast address, the usable host range, the mask and its inverse, and how many hosts actually fit. It replaces a page of binary arithmetic with an answer you can paste straight into a change ticket.
How subnetting works
An IPv4 address is 32 bits. The CIDR prefix says how many of those bits identify the network;
the remainder identify the host. In a /24, the first 24 bits are fixed and the last 8 are
host space, giving 28 = 256 addresses.
Two of those are normally reserved: the address with all host bits set to zero is the network identifier, and the address with all host bits set to one is the directed broadcast. That leaves 254 assignable hosts - the familiar "minus two".
Shorten the prefix and the block doubles each time: a /23 spans 512 addresses, a /16 spans
65,536. Lengthen it and the block halves - a /30 leaves exactly two usable addresses, which is why it was
the traditional choice for a router-to-router link.
The /31 and /32 exceptions
The "minus two" rule has two exceptions that trip up a lot of calculators. RFC 3021
defines /31 for point-to-point links: because there is no need for a broadcast on a two-node link,
both addresses are usable. Using /31 instead of /30 halves the address consumption
of a large router network.
A /32 is a single host route - a loopback interface, a virtual IP, or the target of a static route.
Neither case has a network or broadcast reservation, and this calculator reports both correctly.
Wildcard masks
The wildcard mask is the bitwise inverse of the subnet mask, and it is what Cisco access lists and OSPF
network statements expect. Where a subnet mask of 255.255.255.0 means "match the first 24
bits", the wildcard 0.0.0.255 expresses the same thing inverted. Getting these backwards is one of the
most common causes of an ACL that silently matches nothing.
Private, shared and public space
RFC 1918 reserves three ranges for private use: 10.0.0.0/8, 172.16.0.0/12 and
192.168.0.0/16. RFC 6598 adds 100.64.0.0/10 for carrier-grade NAT, which ISPs use between
subscriber CPE and the NAT44 pool - it is not a fourth private range for enterprises to help themselves to.
Note the boundary that catches people out: the RFC 1918 range stops at 172.31.255.255, so
172.32.0.0 is public, globally routed space belonging to someone else.
Common use cases
- Sizing a VLAN before allocating it - confirming a /26 really does give you 62 hosts, not 64.
- Converting between a mask and a prefix when a vendor GUI insists on one and your documentation uses the other.
- Producing the wildcard mask for a Cisco ACL or OSPF network statement without inverting the octets by hand.
- Splitting an allocated block into equal child subnets for a multi-site or multi-VLAN design.
- Checking whether an address is private, CGNAT, link-local or genuinely public during a NAT investigation.
Edge cases and gotchas
- A
/31has two usable addresses and no broadcast (RFC 3021); a/32has exactly one. - Masks must be contiguous.
255.255.0.255is not a valid subnet mask and is rejected rather than guessed at. - Octets with leading zeros (
192.168.01.1) are rejected because some libraries interpret them as octal. - A
/0covers the entire address space - useful as a default route, meaningless as a subnet.