What a subnet calculator is actually computing
An IPv4 address plus a CIDR prefix (like /24) defines a range of addresses — a subnet. The prefix tells you how many bits of the 32-bit address are fixed as the "network" portion, leaving the rest for host addresses. A /24 fixes the first 24 bits, leaving 8 bits — 256 addresses — for hosts on that subnet.
From that single input, this tool derives everything you'd normally work out by hand: the network address (the first address, identifying the subnet itself), the broadcast address (the last address, reserved for sending to every host on the subnet), the usable host range in between, and both the subnet mask and its inverse, the wildcard mask often used in ACLs and routing configuration.
CIDR notation vs. dotted-decimal masks
Networking equipment and documentation use both notations interchangeably: /24 and 255.255.255.0 describe the exact same subnet. This calculator accepts either — type a plain number for CIDR notation, or a full dotted address for a mask, and it converts automatically. Both the IP address and any dotted mask are validated as real IPv4 values (each part 0–255) and, for masks specifically, as a valid contiguous bit pattern — not just four dot-separated numbers that happen to look right.
The two special cases: /31 and /32
Most subnets reserve their first address (network) and last address (broadcast), leaving the rest usable. Two prefixes break that rule: a /31 has only two addresses total and, per RFC 3021, both are usable — this is standard for point-to-point WAN links where a broadcast address is meaningless. A /32 has exactly one address and is typically used as a host route or loopback identifier, not a shared subnet.
Frequently asked questions
How many usable hosts does a /24 have?
254 by traditional convention — 256 total addresses, minus the network address and the broadcast address. This is the theoretical subnet capacity; it doesn't exclude any special-purpose or reserved ranges that might happen to fall inside an unusually large block.
Why was my input rejected even though it looked like a normal IP address?
Likely a leading zero in one of the parts — 192.168.001.010 is rejected even though it's clearly meant as 192.168.1.10. Canonical IPv4 notation doesn't use leading zeros on multi-digit octets, partly because some older systems have historically read a leading-zero number as octal instead of decimal, which can silently change its value. Drop the leading zeros and it'll be accepted.
What's the difference between a subnet mask and a wildcard mask?
They're bitwise inverses of each other. A subnet mask marks network bits with 1s; a wildcard mask (used in access control lists and OSPF configuration) marks the same bits with 0s instead.
Why does my /31 show "endpoints" instead of network/broadcast addresses?
Per RFC 3021, a /31 has only two addresses total, and on a point-to-point link both are usable endpoints — there's no address left over for a directed broadcast. Calling them "network" and "broadcast" the way a normal subnet would misrepresents what they actually are, so this tool labels them as the two endpoints instead.
Can I enter a mask instead of a CIDR number?
Yes — type a dotted-decimal mask like 255.255.255.0 into the same field, and the tool detects and converts it to the equivalent CIDR prefix automatically. A mask like 255.0.255.0 looks superficially similar but isn't a valid contiguous mask, and is rejected rather than silently misinterpreted.
Last reviewed: . Methodology: standard IPv4 CIDR arithmetic (RFC 4632), with RFC 3021 applied for /31 point-to-point subnets.
Working with 128-bit addresses? Use our IPv6 Subnet Calculator.