Enter an IPv4 address and CIDR prefix to instantly get the network address, broadcast address, subnet mask, wildcard mask, usable host range, and IP address class.
Enter an IP address and CIDR prefix to see the subnet breakdown
Subnetting is the process of splitting a larger IPv4 network into smaller, self-contained segments — and doing the binary math by hand is tedious and error-prone. This IP subnet calculator takes any IPv4 address and CIDR prefix length (from /8 down to /30) and instantly returns the network address, broadcast address, subnet mask, wildcard mask, first and last usable host, total address count, usable host count, and the legacy IP address class, all computed with real bitwise operations on the 32-bit integer representation of the address rather than a lookup table.
The calculator first validates that the address you entered is a well-formed IPv4 dotted-decimal address (four octets, each 0–255). It then converts the address into a single 32-bit integer, and converts the CIDR prefix length into a subnet mask by setting the first N bits to 1 and the rest to 0. A bitwise AND between the address and the mask yields the network address; flipping the mask's bits (a bitwise NOT) gives the wildcard mask, and OR-ing that wildcard mask with the network address yields the broadcast address. The first usable host is one address above the network address, and the last usable host is one address below the broadcast address — except for /31 (both addresses usable per RFC 3021) and /32 (a single host).
Correct subnetting prevents two very common and disruptive networking mistakes: assigning overlapping address ranges to different network segments, and under- or over-sizing a subnet so it either runs out of host addresses too soon or wastes a large block of address space that could serve other segments. Whether you're designing VLANs for an office, carving out address space for a cloud VPC, or just studying for a networking certification, seeing the exact network boundaries, broadcast address, and usable host range for a given prefix removes the guesswork from IP address planning.
CIDR notation like /24 tells you how many of the 32 bits in an IPv4 address are the fixed "network" portion. The remaining bits are the "host" portion — more host bits means more usable addresses in that subnet, but also a bigger, less segmented network.
The network address (all host bits 0) identifies the subnet itself and the broadcast address (all host bits 1) is used to reach every device on it. Neither can be assigned to an individual host — only the addresses strictly between them are usable.
Before CIDR existed, IPv4 space was divided into classes: A (1–126, default /8), B (128–191, default /16), C (192–223, default /24), D (224–239, multicast), and E (240–255, experimental/reserved). Classes are legacy today but still show up in networking terminology.
Common questions about IP subnetting
Explore other tech tools