Dahaebom

Subnet Mask Calculator

How many usable hosts does a /24 subnet have?

A /24 (subnet mask 255.255.255.0) has 256 addresses and 254 usable hosts, since the network and broadcast addresses can't be assigned.

CIDR (RFC 4632) · /31 point-to-point (RFC 3021) · IPv6 (RFC 4291) · runs in your browser ·

Examples: 10.0.0.0/16 · 172.16.5.4 255.255.255.0 · 2001:db8::/32

Result

Usable hosts

-

IPv4 subnet cheat sheet (/8 to /32)

CIDRSubnet maskWildcardAddressesUsable hosts
/8255.0.0.00.255.255.25516,777,21616,777,214
/9255.128.0.00.127.255.2558,388,6088,388,606
/10255.192.0.00.63.255.2554,194,3044,194,302
/11255.224.0.00.31.255.2552,097,1522,097,150
/12255.240.0.00.15.255.2551,048,5761,048,574
/13255.248.0.00.7.255.255524,288524,286
/14255.252.0.00.3.255.255262,144262,142
/15255.254.0.00.1.255.255131,072131,070
/16255.255.0.00.0.255.25565,53665,534
/17255.255.128.00.0.127.25532,76832,766
/18255.255.192.00.0.63.25516,38416,382
/19255.255.224.00.0.31.2558,1928,190
/20255.255.240.00.0.15.2554,0964,094
/21255.255.248.00.0.7.2552,0482,046
/22255.255.252.00.0.3.2551,0241,022
/23255.255.254.00.0.1.255512510
/24255.255.255.00.0.0.255256254
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462
/27255.255.255.2240.0.0.313230
/28255.255.255.2400.0.0.151614
/29255.255.255.2480.0.0.786
/30255.255.255.2520.0.0.342
/31255.255.255.2540.0.0.122
/32255.255.255.2550.0.0.011

/31 counts both addresses as usable (RFC 3021); /32 is a single host route.

Something off with the result?
Pick what's wrong and we'll check and fix it. What you entered isn't sent.

For details, email [email protected].

How it's calculated

CIDR (RFC 4632) · /31 point-to-point (RFC 3021) · IPv6 (RFC 4291) · runs in your browser

  • CIDR (RFC 4632): /n means the first n bits are the network. Addresses = 2^(32 − n)
  • Usable hosts = addresses − 2 (network and broadcast). /31 uses both addresses (RFC 3021); /32 is one address
  • Wildcard mask = the subnet mask with every bit flipped. You can also enter a dotted mask (255.255.255.192); masks whose 1 bits are not contiguous are flagged as invalid
  • Address type: private (RFC 1918), shared CGNAT space (RFC 6598), loopback, link-local, multicast or public. Classful class (A–E) is shown for reference only
  • IPv6 (RFC 4291): first and last address and address count for the prefix, compressed per RFC 5952 (longest run of zero groups becomes ::)
  • Everything is calculated in your browser; the address you enter is not sent to a server, analytics or the URL

Frequently asked questions

What does /24 mean in an IP address?

It is CIDR notation (RFC 4632): the first 24 of the 32 bits are the network part. A /24 has the subnet mask 255.255.255.0 and 2^8 = 256 addresses. Leaving out the network address and the broadcast address, 254 are usable for hosts.

How many usable hosts are in a subnet?

Usable hosts = 2^(32 − prefix) − 2, because the first address is the network ID and the last is the broadcast. A /26 gives 62 hosts, a /27 gives 30 and a /30 gives 2. The exceptions are /31, where both addresses are usable on point-to-point links (RFC 3021), and /32, which is a single host.

What is a wildcard mask?

The inverse of the subnet mask: 255.255.255.0 becomes 0.0.0.255. Cisco IOS uses wildcard masks in ACLs and OSPF network statements, while cloud firewalls and security groups usually take CIDR notation such as 10.0.0.0/16.

What are the private IP address ranges?

10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (RFC 1918). They are not routed on the public internet and are used inside home and office networks. 100.64.0.0/10 is shared address space for carrier-grade NAT (RFC 6598).

How big is an IPv6 /64?

A /64 holds 2^64 addresses, about 18.4 quintillion. A /64 is the standard size for a single IPv6 subnet, and sites are commonly assigned a /48 or /56. This calculator shows the first and last address and the address count for any IPv6 prefix.