CIDR Calculator

CIDR Block
Next

Enter a CIDR block like 10.0.42.64/27 and the calculator returns the network address, broadcast address, IP range, total addresses, usable hosts and the corresponding subnet mask. The toolkit you need for AWS VPCs, home labs and network-planning calculations.

How CIDR calculation works

  1. 1

    Enter a CIDR block

    IPv4 notation `a.b.c.d/prefix`. Prefix is 0 (whole internet) to 32 (single host).

  2. 2

    Network and broadcast computed

    AND with the mask gives network; OR with the inverse mask gives broadcast.

  3. 3

    Host range derived

    First host = network + 1; last host = broadcast − 1 (for /31 and /32 the rules differ).

  4. 4

    Compact summary

    Subnet mask, IP range, total addresses and usable hosts, ready to copy.

Common prefix lengths

CIDR Subnet mask Total IPs Usable hosts Typical use
/8 255.0.0.0 16,777,216 16,777,214 Legacy Class A
/16 255.255.0.0 65,536 65,534 Legacy Class B, large corporate
/20 255.255.240.0 4,096 4,094 Medium campus / VPC
/22 255.255.252.0 1,024 1,022 Small campus
/24 255.255.255.0 256 254 Small LAN / subnet
/25 255.255.255.128 128 126 Small team
/26 255.255.255.192 64 62 Small department
/27 255.255.255.224 32 30 Very small subnet
/28 255.255.255.240 16 14 Tiny subnet (AWS minimum)
/29 255.255.255.248 8 6 Point-to-point plus spares
/30 255.255.255.252 4 2 Point-to-point link
/31 255.255.255.254 2 2 Point-to-point (RFC 3021)
/32 255.255.255.255 1 1 Single host / loopback

“Usable hosts” = total − 2 because the first IP is the network address and the last is the broadcast. /31 (RFC 3021) and /32 are special cases where both addresses are usable.

Worked example: 10.0.42.64/27

  • Binary of /27: 11111111.11111111.11111111.11100000
  • Network address: 10.0.42.64 (all host bits 0)
  • Broadcast address: 10.0.42.95 (all host bits 1)
  • First usable host: 10.0.42.65
  • Last usable host: 10.0.42.94
  • Total addresses: 32
  • Usable hosts: 30
  • Subnet mask: 255.255.255.224
  • Wildcard mask: 0.0.0.31

Subnetting tips

  • Always use even prefix boundaries, /24, /25, /26, /27 split cleanly. /23 split into two /24s is clean; /23 into three subnets is painful.
  • Plan for growth, a /26 now can’t be extended without renumbering. Allocate /25 if you think you might double.
  • Cloud VPCs (AWS, GCP, Azure) impose minimum sizes, usually /28 per subnet.
  • Private ranges (RFC 1918): 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. Use these for internal networks.
  • Avoid overlap with VPN and partner networks. 10.0.0.0/8 is so common that home VPNs frequently collide with office VPCs.

Wildcard masks

Cisco ACLs use wildcard masks (inverse of subnet mask):

  • Subnet mask 255.255.255.224 → Wildcard 0.0.0.31
  • Wildcard = all bits flipped. “0” means “must match”, “1” means “any”.

Frequently Asked Questions

First IP in the block is the network address (identifies the subnet itself); last IP is the broadcast address (sent to all hosts). Neither can be assigned to an interface, so usable hosts = total − 2.

This tool is IPv4-focused. IPv6 has 128-bit addresses and different prefix conventions; use a dedicated IPv6 subnet calculator for those (related tool linked below).

/30 has 4 IPs (2 usable, network + broadcast burned). /31 (RFC 3021) has 2 IPs and uses both as host addresses, saves 2 IPs per link. Most modern routers support /31 point-to-point; older gear sometimes doesn’t.

No, this tool summarises a single IPv4 block: network address, broadcast address, IP range, subnet mask, total and usable addresses. To split or combine blocks, use a dedicated subnetting calculator.

Related Tools