Check my IP

Home / Learn

CIDR and Subnet Masks Explained: How to Calculate Them

Updated October 7, 2026 · 6 min read

CIDR notation is a compact way to write a network. In 192.168.1.0/24, the part after the slash says how many bits of the address identify the network. The rest identify devices on it. Once you can read that number, subnetting becomes simple arithmetic.

Reading the number after the slash

An IPv4 address has 32 bits. A /24 uses the first 24 as the network portion, leaving 8 bits for hosts, which gives 28 = 256 addresses. The formula is:

addresses = 2 ^ (32 − prefix length)

A bigger prefix number means a smaller network.

Common IPv4 sizes

CIDRSubnet maskAddressesUsable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/24255.255.255.0256254
/26255.255.255.1926462
/28255.255.255.2401614
/30255.255.255.25242
/31255.255.255.25422 (point-to-point links)
/32255.255.255.25511 (a single host)

Usable hosts are two fewer than the total because the first address is the network address and the last is the broadcast address. The exceptions are /31 and /32.

A worked example

Take 192.168.10.77/26.

  1. A /26 leaves 6 host bits, so each block holds 64 addresses.
  2. Blocks start at .0, .64, .128 and .192. The address .77 falls in the block starting at .64.
  3. Network address: 192.168.10.64.
  4. Broadcast address: 192.168.10.127.
  5. Usable hosts: 192.168.10.65 to 192.168.10.126, which is 62 hosts.
  6. Subnet mask: 255.255.255.192.

Paste it into our subnet calculator to check the answer.

Wildcard masks

A wildcard mask is the inverse of the subnet mask. For 255.255.255.192 it is 0.0.0.63. Some routers and firewalls use wildcard masks in access rules.

CIDR in IPv6

The idea is identical, with 128 bits. A single LAN is normally a /64, a home network is often delegated a /56 or /60 by the provider, and a larger site gets a /48. Because a /64 holds 264 addresses, you never count hosts in IPv6. You plan how many /64 networks you need. See IPv4 vs IPv6.

Where you will see CIDR

  • Cloud security groups and firewall rules, for example 10.0.0.0/16.
  • The private ranges in public vs private IP addresses.
  • Network ownership records. Our WHOIS tool shows the CIDR block an address belongs to.

Try it yourself

See the real numbers for your own connection with our free tools.

Keep reading