HTTPfy

Subnet Calculator

Range, netmask and address count for an IPv4 CIDR.

Subnet Calculator Ready

About Subnet Calculator

Subnet Calculator: CIDR Ranges, Masks and Host Counts

A subnet is a block of IP addresses that share the same network prefix. Enter an IPv4 address, pick a prefix length from /1 to /32, and the calculator returns the range, the address count, the subnet mask, and the long (decimal) and hex forms of each value.

How a Subnet Mask Works

An IPv4 address has 32 bits. The mask marks which bits belong to the network; the rest identify hosts. In 192.168.1.0 with mask 255.255.255.0, the first 24 bits (192.168.1) name the network and the last 8 bits number the hosts.

That /24 holds 256 addresses. The first (192.168.1.0) is the network address and the last (192.168.1.255) is the broadcast address, which leaves 254 for devices. The calculator's "IPs in Range" counts all 256, so subtract 2 for usable hosts on a normal LAN.

CIDR Notation

CIDR writes the prefix length after a slash. 192.168.1.0/24 means the first 24 bits are the network. Each step down doubles the block size:

  • /30: 4 addresses, 2 usable. Older point-to-point links.
  • /29: 8 addresses, 6 usable.
  • /24: 256 addresses, 254 usable. Mask 255.255.255.0.
  • /16: 65,536 addresses. Mask 255.255.0.0.
  • /31: 2 addresses, both usable on point-to-point links (RFC 3021).
  • /32: a single host, common in firewall rules and routing tables.

If you enter a host address such as 10.0.5.77 with /22, the calculator works out the block it belongs to (10.0.4.0 to 10.0.7.255).

Why Split a Network

  • Smaller broadcast domains: broadcasts such as ARP stay inside one subnet, so a busy segment doesn't flood the rest.
  • Access control: routers and firewalls filter traffic between subnets, so you can keep guest Wi-Fi away from servers.
  • Address planning: you give each site, VLAN or cloud VPC a block sized for its hosts instead of one large flat range.

Cloud providers reserve some addresses in each subnet. AWS, for example, keeps the first four and the last one, so a /24 VPC subnet gives you 251 usable addresses.