cidr calculator subnet

Tip: Fill either CIDR notation, or IPv4 + prefix separately. This calculator supports IPv4 subnets.

What is CIDR and why subnet calculation matters

CIDR stands for Classless Inter-Domain Routing. It is the modern way to describe IP networks using a slash notation such as 192.168.1.0/24. The number after the slash indicates how many bits are used for the network portion of the address, while the remaining bits are reserved for hosts.

A CIDR calculator subnet tool helps you quickly find key network details: network address, broadcast address, subnet mask, wildcard mask, usable host range, and total host capacity. This is essential for network planning, VLAN design, firewalls, and troubleshooting routing issues.

How this CIDR subnet calculator works

Enter an IPv4 address and a prefix length. The calculator converts the prefix into a subnet mask and then applies binary operations to produce the full subnet breakdown.

  • Network address: First address in the subnet.
  • Broadcast address: Last address in the subnet (except special /31 and /32 behavior).
  • First and last usable: Assignable host range.
  • Total addresses: Number of IPs in the block.
  • Usable hosts: Typical host count after network/broadcast reservation.

CIDR quick reference

Common prefixes and host capacity

  • /24 = 256 total addresses, 254 usable hosts
  • /25 = 128 total addresses, 126 usable hosts
  • /26 = 64 total addresses, 62 usable hosts
  • /27 = 32 total addresses, 30 usable hosts
  • /28 = 16 total addresses, 14 usable hosts
  • /29 = 8 total addresses, 6 usable hosts
  • /30 = 4 total addresses, 2 usable hosts
  • /31 = 2 addresses, often used point-to-point
  • /32 = 1 host route
Practical tip: When sizing a subnet, include growth. If you need 40 hosts today, a /26 (62 usable) is usually better than a /27 (30 usable).

Examples

Example 1: 192.168.10.75/26

A /26 has a block size of 64 addresses. The subnet containing 192.168.10.75 is 192.168.10.64/26. Broadcast is 192.168.10.127 and usable hosts are 192.168.10.65 through 192.168.10.126.

Example 2: 10.20.30.40/20

/20 corresponds to subnet mask 255.255.240.0. Network boundary in the third octet changes in increments of 16. So this host belongs to 10.20.16.0/20 with broadcast 10.20.31.255.

Common subnetting mistakes to avoid

  • Confusing /24 with 255.255.0.0 (that is /16).
  • Forgetting that traditional subnets reserve network and broadcast addresses.
  • Not accounting for infrastructure IPs (gateways, firewalls, switches).
  • Using subnets too small for expected growth.
  • Mixing decimal and binary boundaries incorrectly in manual calculations.

When to use /31 and /32

A /31 subnet is commonly used on point-to-point links where only two endpoints exist. A /32 is a single host route, often seen in loopbacks, ACL entries, and route advertisements. This calculator handles both cases explicitly.

Final thoughts

CIDR subnetting is one of the most practical skills in networking. Once you understand prefixes and address ranges, routing and segmentation become far easier to manage. Use this calculator as a fast check during design, audits, lab work, or production troubleshooting.

🔗 Related Calculators