Skip to content Use Monity from Claude, ChatGPT or Codex: set up monitors and ask what changed, from a chat. Use Monity from Claude, ChatGPT or Codex Connect yours
Tutorial 3 min read

Subnet mask cheat sheet: CIDR, masks and host counts

Computed IPv4 subnet mask cheat sheet from /8 to /32 with wildcard masks and usable host counts, RFC 1918 private blocks, and IPv6 /48, /56 and /64 prefixes from RFC 4291 and RFC 6177.

Alex Lead Product Designer
UpdatedNovember 28, 2026 Read time3 min AudienceNetwork engineers, sysadmins and developers

An IPv4 address is 32 bits long. A CIDR prefix /n leaves 32 − n host bits. That gives 2^(32−n) total addresses and 2^(32−n) − 2 usable host addresses on ordinary subnets from /8 through /30. For quick checks on any IPv4 or IPv6 block, use the free Subnet Calculator on Monity (monity.ai), which calculates the subnet, address range and count in your browser.

IPv4 subnet mask table (/8 to /32)

Every row below is computed from 32-bit network arithmetic. The wildcard mask is the bitwise inverse of the subnet mask (255.255.255.255 minus the mask). Routers use wildcard masks in access control lists and OSPF network statements.

CIDR Subnet mask Wildcard mask Total addresses Usable hosts
/8 255.0.0.0 0.255.255.255 16,777,216 16,777,214
/9 255.128.0.0 0.127.255.255 8,388,608 8,388,606
/10 255.192.0.0 0.63.255.255 4,194,304 4,194,302
/11 255.224.0.0 0.31.255.255 2,097,152 2,097,150
/12 255.240.0.0 0.15.255.255 1,048,576 1,048,574
/13 255.248.0.0 0.7.255.255 524,288 524,286
/14 255.252.0.0 0.3.255.255 262,144 262,142
/15 255.254.0.0 0.1.255.255 131,072 131,070
/16 255.255.0.0 0.0.255.255 65,536 65,534
/17 255.255.128.0 0.0.127.255 32,768 32,766
/18 255.255.192.0 0.0.63.255 16,384 16,382
/19 255.255.224.0 0.0.31.255 8,192 8,190
/20 255.255.240.0 0.0.15.255 4,096 4,094
/21 255.255.248.0 0.0.7.255 2,048 2,046
/22 255.255.252.0 0.0.3.255 1,024 1,022
/23 255.255.254.0 0.0.1.255 512 510
/24 255.255.255.0 0.0.0.255 256 254
/25 255.255.255.128 0.0.0.127 128 126
/26 255.255.255.192 0.0.0.63 64 62
/27 255.255.255.224 0.0.0.31 32 30
/28 255.255.255.240 0.0.0.15 16 14
/29 255.255.255.248 0.0.0.7 8 6
/30 255.255.255.252 0.0.0.3 4 2
/31 255.255.255.254 0.0.0.1 2 2* (RFC 3021)
/32 255.255.255.255 0.0.0.0 1 1 (host route)

*On standard broadcast subnets, a /31 leaves zero usable host addresses. Under RFC 3021, routers may use a 31-bit prefix on a point-to-point link so both addresses are usable.

How to read CIDR, masks and host counts

In CIDR notation, the number after the slash counts the leading 1 bits in the 32-bit mask. The remaining bits identify hosts inside that subnet.

  • Network and broadcast addresses: On subnets from /8 to /30, two addresses are reserved. The lowest address (all host bits 0) is the network address. The highest address (all host bits 1) is the broadcast address. Subtract 2 from total addresses to get usable hosts.
  • Worked example (192.168.10.0/26): A /26 leaves 6 host bits, or 2^6 = 64 total addresses. The subnet mask is 255.255.255.192, and the wildcard mask is 0.0.0.63. The network address is 192.168.10.0, the 62 usable hosts run from 192.168.10.1 to 192.168.10.62, and the broadcast address is 192.168.10.63.
  • Single-host routes (/32): All 32 bits are fixed. Use /32 for a single IPv4 host in a firewall rule, loopback interface or static route.

Private IPv4 address ranges (RFC 1918)

RFC 1918, Section 3 reserves three IPv4 blocks through IANA for private internets. Any organization can use them internally without coordinating with an Internet registry. Private addresses cannot route directly over the public Internet without translation.

CIDR block Address range RFC 1918 name Total addresses Pre-CIDR equivalent
10.0.0.0/8 10.0.0.0 – 10.255.255.255 24-bit block 16,777,216 1 Class A network
172.16.0.0/12 172.16.0.0 – 172.31.255.255 20-bit block 1,048,576 16 contiguous Class B networks
192.168.0.0/16 192.168.0.0 – 192.168.255.255 16-bit block 65,536 256 contiguous Class C networks

IPv6 prefixes: /48, /56 and /64

IPv6 addresses are 128 bits long. RFC 4291 (Sections 2.5.1 and 2.5.4) splits Global Unicast addresses into an n-bit global routing prefix, an m-bit subnet ID, and a 64-bit interface ID (n + m = 64). That 64-bit interface ID requirement applies to all unicast addresses except those starting with binary 000. As a result, a standard IPv6 link subnet is a /64.

End-site allocations sit above that /64 boundary. RFC 6177 (BCP 157) obsoleted RFC 3177’s single default /48 recommendation. It notes that APNIC, ARIN and RIPE revised policies to encourage smaller /56 blocks for end sites while avoiding hard-coded prefix boundaries.

IPv6 prefix Subnet ID bits Number of /64 subnets Common role
/48 16 bits 65,536 Larger sites or enterprise allocations
/56 8 bits 256 Smaller end sites and branch allocations (RFC 6177)
/64 0 bits 1 (2^64 interface addresses) Standard single LAN or link subnet (RFC 4291)

Verify subnets and monitor public hosts

Use Monity’s free Subnet Calculator to check any IPv4 CIDR mask or IPv6 block without doing binary math by hand. Once hosts on a public subnet are live, test them with Monity’s free Ping Check (ICMP ping from Monity’s network) and Port Checker (TCP port check).

For scheduled checks on public websites, APIs, TCP ports or DNS records, Monity’s uptime monitoring runs every 5 minutes on the Free plan ($0/month, 3 monitors, 100 credits a month). Paid plans check every minute or every 30 seconds by plan, and 1,000 uptime checks use 1 credit. Failed checks are re-checked 3 and 6 seconds later before alerting over email, Slack, Microsoft Teams, Discord, Telegram, Google Sheets, signed webhooks or phone push.

Monity uptime monitor view for monity.ai displaying 24-hour, 7-day and 30-day uptime percentages, SSL certificate days remaining, a 30-day response time chart and a 90-day daily uptime bar
An uptime monitor in Monity showing 30-day response time, SSL certificate days left and 90-day uptime history for a public host.

Watching the services on your subnets

Monity’s uptime checks run from Monity’s servers on the public Internet, so they watch your public-facing services, TCP ports and DNS. Private RFC 1918 ranges (10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16) don’t route across the public Internet, so watch internal subnets from inside your own network. Monity’s checks don’t ping (ICMP) or run traceroutes.

FAQ

Questions people ask

Why does a /24 subnet have 254 usable hosts instead of 256?

A /24 block contains 2^8 = 256 addresses. Two are reserved on standard broadcast subnets: the first address (all host bits 0) is the network identifier, and the last address (all host bits 1) is the broadcast address, leaving 254 usable host addresses.

Can a /31 subnet be used for host addresses?

Not on a normal broadcast Ethernet LAN, because subtracting network and broadcast addresses leaves zero. However, RFC 3021 allows routers to use a /31 prefix on point-to-point links, making both addresses usable with no wasted space.

How do you calculate a wildcard mask from a subnet mask?

Subtract each octet of the subnet mask from 255. For example, a /26 mask of 255.255.255.192 has a wildcard mask of 0.0.0.63 (255 minus 192 equals 63).

Are RFC 1918 private addresses routable on the public Internet?

No. Under RFC 1918, 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are reserved for private networks and are only unique inside an organization. Hosts using them need NAT or a proxy to communicate over the public Internet.

Why is /64 the standard IPv6 subnet size?

RFC 4291 Sections 2.5.1 and 2.5.4 require a 64-bit interface identifier for all IPv6 unicast addresses except those beginning with binary 000, leaving 64 bits for the global routing prefix plus subnet ID (n + m = 64).

How many /64 subnets fit inside an IPv6 /48 or /56?

A /48 gives 16 subnet ID bits above the /64 boundary, which is 2^16 = 65,536 subnets. A /56 gives 8 subnet ID bits, which is 2^8 = 256 subnets.

Written by

Alex

Alex leads product design at Monity. From the plain-English setup to the way an alert is laid out, her work is about making website monitoring something anyone can use, technical or not. She writes here about product design and usability.

More by author
Kamil, Alex and Martyna A person replies within two working days

Have a question?

Pricing, security or scoping: pick one and your message goes to a person on the team.