Subnet calculator (IPv4)

Enter an address with a prefix such as 192.168.1.10/24, or an address and a mask such as 10.0.0.5 255.255.252.0.

How subnetting works

An IPv4 address has 32 bits. The prefix length (the number after the slash) says how many of those bits identify the network; the rest identify hosts inside it. A /24 keeps 24 network bits and leaves 8 for hosts: 28 = 256 addresses, of which 254 are usable because the first (network address) and the last (broadcast) are reserved. Point-to-point links often use /31(RFC 3021), where both addresses are usable, and /32 describes a single host.

The full explanation, with worked examples, is in What is a subnet mask.

CIDR to subnet mask reference

CIDRSubnet maskAddressesUsable hosts
/8255.0.0.016,777,21616,777,214
/9255.128.0.08,388,6088,388,606
/10255.192.0.04,194,3044,194,302
/11255.224.0.02,097,1522,097,150
/12255.240.0.01,048,5761,048,574
/13255.248.0.0524,288524,286
/14255.252.0.0262,144262,142
/15255.254.0.0131,072131,070
/16255.255.0.065,53665,534
/17255.255.128.032,76832,766
/18255.255.192.016,38416,382
/19255.255.224.08,1928,190
/20255.255.240.04,0964,094
/21255.255.248.02,0482,046
/22255.255.252.01,0241,022
/23255.255.254.0512510
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422
/32255.255.255.25511

More network tools

Guides