HomeTech › IP Subnet

IP Subnet Calculator

Network address
IP class
Broadcast address
First usable IP
Last usable IP
Total hosts
Usable hosts
Subnet mask
Wildcard mask
Binary subnet mask
Show the math
Enter values to see the worked formula.

What Your Result Means

How This Calculator Works

You enter an IPv4 address and a CIDR prefix length (or dotted-decimal mask). The tool converts the IP to a 32-bit integer, builds a bitmask from the prefix, then performs bitwise AND to get the network address and bitwise OR with the inverted mask to get the broadcast. Host count is 2^(32 − prefix) minus 2 for network and broadcast. It does not handle IPv6 or non-contiguous masks.

Quick Questions

What is a CIDR prefix?

CIDR (Classless Inter-Domain Routing) notation uses a slash followed by the number of leading 1-bits in the subnet mask. For example, /24 means the first 24 bits are the network portion, leaving 8 bits (256 addresses, 254 usable) for hosts.

Why are two addresses always "lost" from the host count?

The first address is reserved as the network identifier and the last as the broadcast address. Neither can be assigned to a device, so usable hosts = 2^(host bits) − 2. The exception is /31 (RFC 3021), where both addresses are usable on point-to-point links.

What is the wildcard mask used for?

The wildcard mask is the inverse of the subnet mask (all 0s become 1s and vice versa). It tells a router which bits to "don't care" about when matching an ACL rule. For example, a /24 subnet mask of 255.255.255.0 has a wildcard of 0.0.0.255.

Does this work with IPv6?

No. This calculator handles IPv4 only. IPv6 addresses are 128 bits with different notation and prefix rules. CIDR concepts still apply, but the math uses a much larger address space.

What about /31 and /32 subnets?

A /31 has only 2 addresses and no broadcast — it is used for point-to-point links per RFC 3021. A /32 is a single host route with exactly one address and zero usable hosts, typically used in routing tables or loopback interfaces.

Sources

Method & review

MethodologyHow we calculate this Reviewed & Updated2026-04 Next review2027-04

Estimate only. Results reflect your inputs and standard formulas. Double-check important decisions independently.