An IP subnet calculator answers the questions that come up every time you carve an address range into networks: where does this subnet start, where does it end, which addresses can I actually assign to machines, and what mask do I put in the interface configuration. Doing it by hand means converting to binary, applying a bitwise AND, and converting back — reliable, but slow and easy to fumble at three in the morning during a change window.
This calculator handles every prefix from /0 to /32, including the two that trip up most tools: /31, which carries two usable addresses rather than none, and /32, which describes a single host. Arb Digital built it as part of the free developer toolset on this site, and like everything else here it runs entirely in your browser.
What This Subnet Calculator Does
Give it any IPv4 address inside a subnet plus a prefix length, and it returns the network address, the broadcast address, the dotted-decimal subnet mask, the wildcard mask, the count of usable host addresses, and the first and last assignable address in the range. It does not matter which address in the range you type — 192.168.10.37/26 and 192.168.10.1/26 both resolve to the same network, because the network address comes from masking off the host bits.
The detail panel adds the binary representation of the address and mask, the total address count including network and broadcast, and a note on whether the address falls in a private, loopback, link-local, multicast, or public range. If you prefer to work from a dotted-decimal mask such as 255.255.255.192, the mask selector fills in the matching prefix for you.
How to Use It
- Enter any address in the subnet. A host address is fine; the tool derives the network address itself.
- Set the prefix length. Type the number after the slash — 24 for
/24, 26 for/26. Values from 0 to 32 are accepted. - Or choose a mask instead. Pick a dotted-decimal mask from the selector and the prefix updates to match.
- Read the four key figures. Broadcast, mask, wildcard, and usable host count are the values you will most often need to type into a configuration.
- Copy the full detail into your change record so the range you allocated is documented alongside the change.
The Formula / How It's Calculated
An IPv4 address is 32 bits, written as four decimal octets. A prefix length says how many of those leading bits identify the network; the rest identify the host. Everything else follows from bitwise arithmetic on those 32 bits.
The subnet mask is the prefix expressed as a bit pattern: prefix ones followed by 32 − prefix zeros. A /26 mask is twenty-six 1 bits then six 0 bits, which is 255.255.255.192. The network address is the address ANDed with the mask, which zeroes every host bit. The broadcast address is the network ORed with the inverted mask, which sets every host bit to one. The wildcard mask is simply that inverted mask written in dotted decimal — 0.0.0.63 for a /26.
Total addresses in the block is 2(32 − prefix). For prefixes of /30 and shorter, usable hosts is that total minus two, because the all-zeros network address and the all-ones broadcast address are not assignable to interfaces. A /26 therefore holds 64 addresses and 62 usable ones. Worked through with the default values: 192.168.10.37 with a /26 mask gives a network of 192.168.10.0, a broadcast of 192.168.10.63, and an assignable range of 192.168.10.1 through 192.168.10.62.
Why /31 and /32 Break the Minus-Two Rule
Applied naively, "total minus two" says a /31 has zero usable addresses and a /32 has minus one. Both answers are wrong in practice, and both prefixes are used constantly.
RFC 3021 defines /31 for point-to-point links. On a link with exactly two endpoints there is no need to reserve a broadcast address, because anything sent to one end can only arrive at the other. Both addresses in the /31 are assignable, which halves the address waste on router-to-router links compared with the /30 that was traditionally used. This calculator reports two usable addresses for a /31, which is what a router will accept.
A /32 describes a single address with no host bits at all. It is used for loopback interfaces, host routes, and individual entries in firewall and access rules. There is no network or broadcast address to reserve, so the single address is usable. A tool that reports zero or a negative number for these prefixes is applying a rule outside the range where it holds.
Reading Subnet Boundaries Without Converting to Binary
For prefixes between /25 and /30 the whole subnet fits inside one octet, and there is a shortcut worth internalising. Take 256 minus the last octet of the mask to get the block size: a /26 mask ends in 192, so the block size is 64, and subnets start at 0, 64, 128, and 192. A /27 mask ends in 224, block size 32, so subnets start at 0, 32, 64, 96 and so on.
Once you know the block size, finding which subnet an address belongs to is a division. Address .37 with a block size of 64 falls in the block starting at 0, so the network is .0 and the broadcast is one below the next boundary at .63. That mental method takes seconds and matches exactly what this calculator computes bitwise — useful for sanity-checking a result rather than trusting any single tool blindly.
Sizing a Subnet Without Running Out of Room
The common planning error is sizing a subnet to the number of devices present today. A /29 gives six usable addresses, which is comfortable for five devices right up to the day someone adds a printer and a spare switch. Renumbering an in-use subnet is disruptive work, so the usable figures matter at design time more than at configuration time.
Two details are easy to forget when counting. The default gateway consumes one usable address in every routed subnet. And any device with more than one interface on the segment, or any virtual IP used for failover between a pair of firewalls or load balancers, consumes an address of its own. Counting gateways and virtual addresses alongside hosts before choosing a prefix avoids the awkward discovery that a /28 holds fourteen usable addresses and you need fifteen.
Private, Public, and the Ranges With Special Rules
Three IPv4 ranges are reserved for private use and are never routed on the public internet: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. The middle one is the most misremembered — it is not all of 172, and it is not just 172.16. It spans 172.16.0.0 through 172.31.255.255, which the /12 prefix defines precisely. The full list of reserved ranges is maintained by IANA in the IPv4 special-purpose address registry.
Other ranges carry their own behaviour. 127.0.0.0/8 is loopback. 169.254.0.0/16 is link-local, self-assigned when a host cannot reach a DHCP server — an address in that range is usually a symptom, not a configuration. 100.64.0.0/10 is carrier-grade NAT space, which occasionally appears inside service provider networks and confuses anyone who expects it to be private space. The detail panel labels whichever range your address falls into.
Classful Notation Is Historical, and It Still Causes Confusion
Before classless routing, the first bits of an address determined a fixed mask: class A meant /8, class B meant /16, class C meant /24. That system was replaced by CIDR in 1993 because it wasted enormous amounts of address space, yet the vocabulary survives in documentation, in exam questions, and in the habit of assuming that a 192.168 network is automatically a /24.
It is not. 192.168.0.0/16 is a perfectly valid private supernet, and 10.20.30.0/28 is a perfectly valid small subnet inside class A space. The prefix is the only thing that defines the boundary. When someone describes a network by its address alone, the prefix is the missing information you should ask for rather than infer.
Arb Digital's web development team plans hosting, DNS, and network configuration alongside the build, so addressing and access rules are documented before anything goes live.
Web Development Services Talk to Arb DigitalCommon Mistakes to Avoid
- Assigning the network or broadcast address to a host. On any prefix of /30 or shorter, the first and last addresses in the block are reserved.
- Applying the minus-two rule to /31 and /32. A /31 has two usable addresses on point-to-point links, and a /32 has one.
- Entering a wildcard mask where a subnet mask is expected, or the reverse. They are bitwise inverses and both look plausible in a configuration file.
- Assuming 172.x is private. Only 172.16 through 172.31 are; 172.15 and 172.32 are public space.
- Sizing subnets to today's device count without allowing for gateways, virtual IPs, and growth.
Related Free Tools From Arb Digital
Convert the same values between bases with the number base converter, break apart the addresses your links point at with the URL parser, decode client details from a request with the user agent parser, check what a server returned with the HTTP status code lookup, and measure throughput units with the bandwidth converter. The whole set lives in the free online tools hub.
Frequently Asked Questions
A /24 contains 256 addresses, of which 254 are usable. The first address is the network address and the last is the broadcast address, and neither can be assigned to an interface.
RFC 3021 allows /31 prefixes on point-to-point links, where no broadcast address is needed because a packet can only reach the single device at the other end. Both addresses are assignable.
It is the bitwise inverse of the subnet mask and is used in access control lists and routing statements on several platforms, where a zero bit means the bit must match and a one bit means it is ignored.
Any address in the range works. The calculator masks off the host bits to find the network address, so a host address produces exactly the same result.
10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 are reserved for private use. The middle range covers 172.16 through 172.31 only, not the whole of 172.
That is link-local space, which a host assigns itself when it cannot reach a DHCP server. Seeing one usually indicates a DHCP or cabling problem rather than an intentional configuration.
No, it is IPv4 only. IPv6 uses 128-bit addresses and different conventions, including the absence of broadcast addresses, so it needs separate handling.
Results describe standard IPv4 addressing. Individual platforms may reserve additional addresses within a subnet for their own use.