IPv4 Subnet Calculator
Calculate detailed IPv4 subnet information including network address, broadcast address, usable host range, subnet mask, wildcard mask, and classful address classification.
CIDR Input
Understanding IPv4 Subnet Calculations
An IPv4 address is a 32-bit number typically written in dotted decimal notation as four octets separated by periods (e.g., 192.168.1.0). The subnet mask determines which portion of the address represents the network and which portion represents the host. In CIDR (Classless Inter-Domain Routing) notation, this is expressed as a prefix length following the IP address, such as 192.168.1.0/24, where /24 indicates that the first 24 bits are the network prefix.
Classful addressing divides the IPv4 address space into five classes: Class A (0.0.0.0–127.255.255.255, /8 default mask) for large networks with up to 16 million hosts; Class B (128.0.0.0–191.255.255.255, /16 default mask) for medium-sized networks with up to 65,534 hosts; and Class C (192.0.0.0–223.255.255.255, /24 default mask) for small networks with up to 254 hosts. Classes D and E are reserved for multicast and experimental use respectively.
Each subnet calculation reveals critical information for network engineers: the network address (the first address identifying the subnet itself), the broadcast address (the last address used for sending traffic to all hosts on the subnet), the first and last usable host addresses, the total number of addresses, and the number of usable hosts (total minus network and broadcast addresses for subnets larger than /31). For point-to-point links, /31 subnets provide 2 usable addresses with no separate network or broadcast, while /32 subnets represent a single host.
Understanding binary representation is fundamental to subnetting. Each octet of an IPv4 address represents 8 bits, and the subnet mask is a sequence of contiguous 1-bits followed by 0-bits. The bitwise AND of the IP address and the subnet mask yields the network address, while the bitwise OR of the network address with the inverted mask yields the broadcast address. Our calculator displays both binary representations to help you visualise this relationship. Whether you are designing a new network, auditing an existing allocation, or studying for a certification exam, this calculator provides the foundational information you need.
Worked Example: 10.0.0.0/19
Consider the network 10.0.0.0/19. The subnet mask is 255.255.224.0 — the first 19 bits are the network prefix and the remaining 13 bits are for hosts. The network address is10.0.0.0, and the broadcast address is10.0.31.255. Usable host addresses range from10.0.0.1 to10.0.31.254, providing 8,190 usable hosts. In binary, the third octet (the interesting octet) ranges from 00000000to 00011111 — the first 3 bits are fixed (the network portion) while the last 5 bits vary across hosts. This calculation demonstrates how a /19 boundary falls mid-octet, unlike traditional classful boundaries, illustrating the flexibility CIDR provides for right-sizing subnets to actual requirements.