Prefix Length, Block Size & Usable Hosts
IPv4 has 32 address bits and IPv6 has 128. A prefix of length p leaves 32 − p or 128 − p host bits; the full block contains two raised to that number of addresses. Increasing the prefix length by one halves the block size.
For standard IPv4 LANs through /30, subtract network and broadcast addresses to get usable capacity. An explicit /31 point-to-point link uses both addresses under RFC 3021, and /32 identifies one address. Cloud reservations are different: consult the cloud subnet comparison.
IPv6 does not have an IPv4-style broadcast address. A /64 is the usual subnet size for SLAAC; a /127 has a different point-to-point use. An exact address count is not an interface-capacity recommendation.
Put the Reference to Work
Use the calculator for boundaries and notation, the planner for capacity requirements, or range tools for exact coverage. The tables above can be expanded for all prefixes.