Skip to content

IP Subnet Calculator

Handles /31 and /32 properly, which most do not.

Work out IP Subnet. Handles /31 and /32 properly, which most do not. Names the misconception directly.

Written and maintained by Mohit PatelLast checked August 4, 2026How we build these

IPv4, in dotted decimal.

/

Network

192.168.1.0/24

254 usable hosts · mask 255.255.255.0

Network address192.168.1.0
Usable host range192.168.1.1 to 192.168.1.254
Broadcast address192.168.1.255
Subnet mask255.255.255.0
Wildcard mask0.0.0.255
Usable hosts254
Total addresses256
Address classC
Private rangeYes — RFC 1918
Mask in binary11111111.11111111.11111111.00000000

The network address is the IP with all host bits cleared, and the broadcast is the same with all host bits set. Both are unusable for hosts on an ordinary subnet, which is why the usable count is two below the total. Two prefixes are exceptions and both are handled here. A /32 is a single host route with no broadcast, and a /31 under RFC 3021 is a point-to-point link where both addresses are usable — the general formula gets both wrong and returns a negative count for the /31. Private ranges — 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 — are not routable on the public internet, which is why they can be reused in every network without conflict.

How the IP Subnet Calculator works

Network address, broadcast, usable range and mask for any IPv4 address and prefix. The /31 and /32 cases are handled explicitly — the general formula returns a negative host count for a /31, which is a real point-to-point link.

Also known as: how many hosts in a /24 · subnet mask for a prefix · network and broadcast address · what subnet is this ip in

Frequently asked questions

How many hosts are in a /24?

254 usable out of 256 addresses. The network address and the broadcast address are both unusable for hosts, which is where the two go.

What is a /31 for?

Point-to-point links. Under RFC 3021 both addresses are usable and there is no broadcast, which saves two addresses on every router-to-router link — significant across a large network.

What is a wildcard mask?

The bitwise complement of the subnet mask. Cisco access control lists and OSPF use it instead of the mask, and mixing the two up is a classic configuration error.

Which ranges are private?

10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 under RFC 1918, plus 169.254.0.0/16 for link-local. None is routable on the public internet, which is why they can be reused everywhere.

Do address classes still matter?

Not for routing — classless inter-domain routing replaced them in 1993. They survive as terminology and in some default behaviours, which is why the class is still reported here.

Put this calculator on your own site

Free to use, on any site, commercial or not. Paste this where you want it to appear. It is a plain iframe, so it works in WordPress, Squarespace, Wix, Webflow, Ghost and anything else that accepts HTML.

The one-line version
<iframe src="https://www.thecalclibrary.com/embed/ip-subnet-calculator" width="100%" height="640" style="border:1px solid #e2e8f0;border-radius:12px" loading="lazy" title="IP Subnet Calculator"></iframe>
<p style="font:13px/1.5 system-ui,sans-serif;margin:6px 0 0;color:#64748b">Powered by <a href="https://www.thecalclibrary.com/ip-subnet-calculator" style="color:#64748b">IP Subnet Calculator</a> from The Calc Library</p>

The only condition is that the credit line below the frame stays in place. That one line is what pays for the tool being free — it is how anyone else finds it.

Related calculators