CIDR and Subnet Masks Explained with Worked Examples
How prefix lengths map to masks, how to compute network, broadcast and usable host ranges, and common sizing mistakes.
Prefix = mask
/24 means the first 24 bits are network bits: mask 255.255.255.0, 256 addresses. Usable hosts = 2^(32−prefix) − 2 (network and broadcast reserved) — except for /31 point-to-point links and /32 host routes.
Sizing mistakes
Off-by-one on prefix length halves or doubles the space. Always reserve for growth: a /23 costs one bit and doubles your addresses. The calculator shows binary breakdown so the arithmetic is visible.
IPv6 shorthand
Leading zeros per group can drop, and one run of zero groups collapses to ::. RFC 5952 mandates the longest-run rule and lowercase hex — the compressor follows it exactly.
Strumenti correlati
IPv4 Subnet / CIDR CalculatorNetwork address, broadcast, wildcard, mask and host range from any CIDR.IP to Decimal ConverterConvert IPv4 addresses to 32-bit integers and back.IPv6 Address CompressorCompress IPv6 to its shortest RFC 5952 form.MAC Address ValidatorValidate MAC formats and inspect unicast/multicast and admin bits.