ManyTools

IPv4 Subnet Calculator

Enter an IPv4 address and prefix to get the network, broadcast, mask, wildcard and usable host range.

Last updated: September 28, 2026How this is calculated →

A subnet is found by keeping the first bits of an IPv4 address, as many as the prefix length says, and zeroing the rest. For 192.168.1.10/24 the mask is 255.255.255.0, so the network is 192.168.1.0 and the broadcast is 192.168.1.255. A /24 holds 256 addresses; take away the network and broadcast addresses and 254 are left for hosts, running from 192.168.1.1 to 192.168.1.254.

This calculator does IPv4 subnet arithmetic only. It does not check whether an address is assigned, reachable or free on your network, and it does not handle IPv6. Check addressing plans against your own network documentation before changing a live router or firewall.

Network

192.168.1.0/24

Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Network address
192.168.1.0
Broadcast address
192.168.1.255
First usable host
192.168.1.1
Last usable host
192.168.1.254
Total addresses
256
Usable hosts
254
Private range (RFC 1918)
Yes
Mask in binary
11111111.11111111.11111111.00000000

Embed this calculator on your site →

About the Subnet Calculator

An IPv4 address is 32 bits written as four octets, and the prefix length after the slash says how many of those bits name the network; the rest name a host inside it. The subnet mask writes the same thing out: /26 is twenty-six one-bits then six zero-bits, which reads as 255.255.255.192. The network address keeps the address bits wherever the mask has a one and zeroes the others. The broadcast address sets every host bit to one. A prefix p block holds 2 to the power of (32 minus p) addresses: a /24 block holds 256 addresses, a /26 holds 64 and a /30 holds 4. Take away the network and broadcast addresses and you have the usable hosts. Two prefixes break that rule: a /31 is a point-to-point link with two usable addresses and no broadcast, and a /32 is a single address. The wildcard mask is the mask with every bit flipped, the form router access lists expect. Type an address and pick a prefix, or type a.b.c.d/p, and the calculator returns all of these plus whether the address is in a private block. IPv6 is not handled here.

Frequently asked questions

How do I work out the network address by hand?+

Write the address and the mask in binary and AND them bit by bit. For 172.16.5.130/26, the last octet 130 is 10000010 and the mask's last octet 192 is 11000000; the AND is 10000000, which is 128. The first three octets are untouched by a 255 mask, so the network is 172.16.5.128 and the broadcast, with the six host bits set, is 172.16.5.191.

Why are there 254 usable hosts in a /24 and not 256?+

A /24 has 8 host bits, which gives 256 addresses. The one with all host bits at zero is the network address and the one with all host bits at one is the broadcast address, so neither is assigned to a device. That leaves 254. The same subtraction of two applies to every prefix up to /30, which leaves 2 hosts out of 4.

What is a /31 used for?+

A /31 has only two addresses, which under the old rule would leave zero hosts. Point-to-point links between two routers do not need a network or broadcast address, so both addresses are treated as usable. The calculator shows 2 usable hosts for a /31 and no broadcast address.

What is a wildcard mask?+

It is the subnet mask with every bit inverted, so 255.255.255.0 becomes 0.0.0.255 and 255.255.240.0 becomes 0.0.15.255. A zero bit means that bit must match and a one bit means it can be anything. Router access lists and OSPF network statements take wildcard masks instead of subnet masks.

Which addresses are private?+

Three blocks are set aside for private networks: 10.0.0.0/8, 172.16.0.0/12 (172.16.0.0 to 172.31.255.255) and 192.168.0.0/16. Addresses in them are not routed on the public internet, which is why home routers hand out 192.168.x.x addresses. The calculator flags whether the address you enter falls in one of these blocks.

Embed this calculator

Free to use on your own site. Paste this snippet where you want the subnet calculator to appear — it resizes itself automatically.

Embed code
<iframe
  src="https://manytools.co/embed/subnet-calculator"
  title="Subnet Calculator by ManyTools"
  data-manytools="subnet-calculator"
  width="100%"
  height="640"
  loading="lazy"
  style="border:0;width:100%;max-width:720px"></iframe>
<script>
(function () {
  window.addEventListener("message", function (e) {
    if (e.origin !== "https://manytools.co") return;
    var d = e.data || {};
    if (d.type !== "manytools:embed:height" || d.slug !== "subnet-calculator") return;
    var f = document.querySelector('iframe[data-manytools="subnet-calculator"]');
    if (f && d.height) f.style.height = d.height + "px";
  });
})();
</script>
Plain link (fallback)
<a href="https://manytools.co/dev/subnet-calculator">Subnet Calculator by ManyTools</a>