FernTool

Subnet mask cheat sheet (CIDR table)

This is the full IPv4 subnet table: each CIDR prefix with its subnet mask, wildcard mask, total addresses and usable hosts. To split a real network (network address, broadcast, first and last host), paste it into the FernTool subnet calculator.

CIDR to subnet mask table

CIDRSubnet maskWildcardAddressesUsable hostsTypical use
/8255.0.0.00.255.255.25516 777 21616 777 214old “class A”
/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 534old “class B”, e.g. 172.16.0.0/16
/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 0224 × /24, common for a small ISP block
/23255.255.254.00.0.1.255512510
/24255.255.255.00.0.0.255256254old “class C”, typical home or office LAN
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462
/27255.255.255.2240.0.0.31323030 hosts, a small VLAN
/28255.255.255.2400.0.0.151614
/29255.255.255.2480.0.0.7866 hosts, a small static IP block from an ISP
/30255.255.255.2520.0.0.3422 hosts, classic router-to-router link
/31255.255.255.2540.0.0.122 (point-to-point link)
/32255.255.255.2550.0.0.011 (single host)one address, e.g. a firewall rule

“Usable hosts” is the address count minus 2, because the first address is the network itself and the last is the broadcast address. /31 is the exception (RFC 3021 lets both addresses be used on a point-to-point link) and /32 is a single address.

How to work it out without a table

  1. Addresses in a subnet = 2 to the power of (32 − prefix). A /26 has 26 = 64 addresses, so 62 usable hosts.
  2. The “interesting” octet is the one where the mask isn’t 255 or 0. For /26 that’s the last octet: 256 − 64 = 192, so the mask is 255.255.255.192.
  3. Subnets start at multiples of the block size. With a block of 64, a /26 network starts at .0, .64, .128 or .192. So 192.168.1.100/26 sits in 192.168.1.64 to 192.168.1.127 (broadcast .127, hosts .65 to .126).

Quick reference for the last octet

/25
block 128: .0 and .128
/26
block 64: .0, .64, .128, .192
/27
block 32: .0, .32, .64 … .224
/28
block 16: .0, .16, .32 … .240
/29
block 8: .0, .8, .16 … .248
/30
block 4: .0, .4, .8 … .252

How many hosts do I need?

Pick the smallest prefix whose usable hosts cover today’s devices plus room to grow. 50 devices fit in a /26 (62 hosts); 200 devices need a /24 (254 hosts); 500 need a /23 (510 hosts). Home routers almost always use a /24 such as 192.168.1.0/24, which is plenty for a house.

Private ranges you can use inside a network

These never appear on the public internet. See public vs private IP, or check your public IP.

What about IPv6?

IPv6 subnets are almost always a /64 for each network (that’s 18 quintillion addresses, so you never count hosts). A home usually gets a /56 or /48 from the ISP, which is 256 or 65 536 separate /64s. The subnet calculator handles IPv6 too. New to it? Read what is IPv6.

Frequently asked questions

What is the subnet mask for /24?

255.255.255.0. A /24 has 256 addresses and 254 usable hosts.

How many hosts are in a /27?

A /27 has 32 addresses and 30 usable hosts. Its mask is 255.255.255.224.

What is a wildcard mask?

The inverse of the subnet mask (255 minus each octet), used in Cisco ACLs and OSPF. The wildcard for 255.255.255.0 is 0.0.0.255.

Why are there two fewer usable hosts?

The first address identifies the network and the last is the broadcast address, so neither can be given to a device (except on /31 and /32).

More guides