sysadmintools

Subnet Calculator

Calculate network, broadcast, host range, and wildcard mask for any IPv4 or IPv6 CIDR. Runs entirely in your browser — nothing is sent to a server.

Network192.168.1.0/24
Prefix length/24
Subnet mask255.255.255.0
Wildcard mask0.0.0.255
Broadcast192.168.1.255
First host192.168.1.1
Last host192.168.1.254
Total addresses256
Usable host IPs254
ScopePrivate

Note: For /31 and /32 IPv4 blocks, host range and broadcast concepts don't apply traditionally — RFC 3021 defines /31 as point-to-point with both addresses usable.

IPv4 subnet reference

Below is a table providing typical subnets for IPv4.

Prefix sizeNetwork maskUsable hosts per subnet
/1128.0.0.02.1B
/2192.0.0.01.1B
/3224.0.0.0537M
/4240.0.0.0268M
/5248.0.0.0134M
/6252.0.0.067.1M
/7254.0.0.033.6M
Class A
/8255.0.0.016.8M
/9255.128.0.08.4M
/10255.192.0.04.2M
/11255.224.0.02.1M
/12255.240.0.01.0M
/13255.248.0.0524K
/14255.252.0.0262K
/15255.254.0.0131K
Class B
/16255.255.0.065.5K
/17255.255.128.032.8K
/18255.255.192.016.4K
/19255.255.224.08.2K
/20255.255.240.04.1K
/21255.255.248.02.0K
/22255.255.252.01.0K
/23255.255.254.0510
Class C
/24255.255.255.0254
/25255.255.255.128126
/26255.255.255.19262
/27255.255.255.22430
/28255.255.255.24014
/29255.255.255.2486
/30255.255.255.2522
/31255.255.255.2542 (point-to-point)
/32255.255.255.2551

Subnet math and the off-by-two

The calculator takes a CIDR prefix and an address and returns the network address, broadcast address, mask and usable host range for IPv4 or IPv6. It works purely on the bit boundaries the prefix defines. Nothing here is inferred from routing or assignment, so the numbers describe the block, not what is actually configured on any device.

The most common source of confusion is the usable host count. In an IPv4 subnet the network and broadcast addresses are not assignable, so a /24 yields 254 usable addresses, not 256. Planning a table of 256 devices against a /24 is how a site ends up two addresses short at the worst possible moment.

Two prefixes break that rule. A /31 is a point-to-point link under RFC 3021 and both addresses are usable, which is standard on router-to-router links. A /32 is a single host route with one address and no broadcast. The reference table below renders a class banner and the matching subnet row from the same fragment, so the two lines are always consistent.

IPv6 has no broadcast address; the all-zeros interface identifier is the subnet-router anycast address, not a host. Watch the larger prefixes especially, since a /64 holds more addresses than any plan will consume, and a /127 point-to-point link is common practice. A frequent planning error is treating the whole block as DHCP space, then discovering the gateway, a virtual IP or a static reservation already sits inside it. Before deploying, confirm the range is not already in use elsewhere in your routing table or an overlapping allocation.

Related reading