Network Tool
Subnet Calculator
Calculate subnets, CIDR ranges, subnet masks, wildcard masks, and host counts for any IPv4 address.
This free subnet calculator turns an IPv4 address and prefix length into everything you need to plan or document a network: the network and broadcast addresses, usable host range, subnet and wildcard masks, total and usable host counts, and the address class and type. Everything runs in your browser — nothing is sent to a server.
How subnet calculation works
An IPv4 address is 32 bits. The prefix length (the /24 in 10.0.0.0/24) says how many leading bits identify the network; the rest identify hosts. The subnet mask is those network bits set to 1 (255.255.255.0 for /24), and the wildcard mask is its inverse (0.0.0.255). The network address is the IP ANDed with the mask; the broadcast address sets every host bit to 1. Usable hosts are the addresses between them — which is 2^(32 − prefix) − 2, because the network and broadcast addresses are reserved.
The /31 and /32 exceptions
Two prefixes break the "minus two" rule. A /32 describes a single host (one usable address — itself), commonly used for loopbacks and host routes. A /31 (RFC 3021) is used on point-to-point links and treats both addresses as usable, giving exactly two hosts with no broadcast address. This calculator handles both cases correctly.
Public, private, and special-use ranges
RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 for private use — these are not routable on the public internet. Other ranges are special: 127.0.0.0/8 is loopback, 169.254.0.0/16 is link-local (APIPA), and 224.0.0.0/4 is multicast. The calculator labels the address type so you can tell at a glance whether a block is routable.
Frequently asked questions
How many usable hosts are in a /24?+
A /24 has 256 total addresses and 254 usable hosts, because the network address (.0) and broadcast address (.255) are reserved.
What is the difference between a subnet mask and a wildcard mask?+
A subnet mask marks the network bits with 1s (255.255.255.0). A wildcard mask is its bitwise inverse (0.0.0.255) and is used in Cisco ACLs and OSPF to match address ranges.
Why does a /30 only have 2 usable hosts?+
A /30 has 4 total addresses, but one is the network address and one is the broadcast address, leaving 2 usable — which is exactly enough for a point-to-point link.
Is this subnet calculator free and private?+
Yes. It is completely free and runs entirely in your browser using JavaScript — your input is never transmitted to or stored on any server.