Subnet Calculator

Calculate network address, broadcast address, usable host range, and number of hosts from an IP address and CIDR prefix.


Subnet math.

Network = IP AND mask
Broadcast = Network OR NOT(mask)
Usable hosts = 2^(32-prefix) − 2

The Fundamentals of IPv4 Subnetting

Subnetting is the practice of dividing a large physical IP network into smaller, logical subnetworks (subnets). In network administration, subnetting is essential for optimizing IP address allocation, improving network routing efficiency, isolating network segments for security, and reducing broadcast traffic. A Subnet Calculator processes IP addresses and CIDR subnet masks, outputting critical network metrics instantly.

CIDR Notation and Bitwise Netmasks

IPv4 addresses are 32-bit binaries divided into four 8-bit octets (e.g., 192.168.1.1). CIDR (Classless Inter-Domain Routing) notation designates the network prefix length using a slash, such as /24. The /24 indicates that the first 24 bits represent the network portion, and the remaining 8 bits represent host devices. The calculator performs bitwise AND operations between the IP and the mask to identify the subnet's network address, broadcast address, and host ranges.

Calculating Usable Host Addresses

For any subnet, the number of total host addresses is 2^(32 - prefix). However, the first address (network address) and the last address (broadcast address) are reserved and cannot be assigned to hosts. Therefore, the number of usable host IPs is 2^(32 - prefix) - 2. For a /24 subnet, this gives 256 - 2 = 254 usable hosts. Subnet calculators help network engineers plan address spaces (such as Class A, B, and C private blocks) without manual binary conversions.

Frequently Asked Questions