CIDR prefix reference table
The table lists common prefix lengths with their dotted-decimal masks and usable host counts under standard CIDR rules.
| Prefix | Subnet mask | Usable hosts |
|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 |
| /16 | 255.255.0.0 | 65,534 |
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /28 | 255.255.255.240 | 14 |
| /29 | 255.255.255.248 | 6 |
| /30 | 255.255.255.252 | 2 |
| /31 | 255.255.255.254 | 2 (point-to-point, RFC 3021) |
| /32 | 255.255.255.255 | 1 (single host route) |
- For /31 networks, RFC 3021 removes the network/broadcast reservation so both addresses are usable on point-to-point links; this calculator reports 2 hosts and shows both addresses as the usable range.
- The private address ranges reserved by RFC 1918 are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 — addresses in these blocks are not routable on the public internet.
- This calculator covers IPv4 only; IPv6 uses 128-bit addresses with its own prefix conventions.
What is IP subnetting and CIDR?
An IPv4 address is a 32-bit number, conventionally written as four decimal octets (for example 192.168.1.10). Subnetting splits the address into a network part, which identifies the subnet, and a host part, which identifies a device within it. The split point is given by the prefix length: /24 means the first 24 bits are the network part, leaving 8 bits for hosts. Subnetting was standardized in RFC 950 (1985).
CIDR — Classless Inter-Domain Routing, specified in RFC 4632 — replaced the old class A/B/C system with arbitrary prefix lengths written in slash notation. The subnet mask is the prefix expressed as a 32-bit pattern of ones followed by zeros: /24 corresponds to 255.255.255.0. Applying the mask to an address with a bitwise AND yields the network address.
Within a conventional subnet, two addresses are reserved: the all-zeros host part is the network address and the all-ones host part is the broadcast address. A /24 subnet therefore offers 2⁸ − 2 = 254 usable host addresses. The exception is /31, which RFC 3021 defines for point-to-point links: with only two addresses and no broadcast, both are usable. A /32 denotes a single host route.
How to use this IP subnet calculator
- Enter any IPv4 address inside the subnet you are working with, in dotted-decimal form (e.g. 192.168.1.10).
- Enter the CIDR prefix length from 0 to 32 — the number after the slash in notation like /24.
- Read the network address, subnet mask and broadcast address computed from the mask.
- Use the first/last usable host range and the host count to plan device addressing within the subnet.
The math behind subnet calculation
The subnet mask for prefix length n is a 32-bit value with n leading one-bits. Network address = IP AND mask; broadcast address = network OR NOT mask; usable hosts = 2^(32−n) − 2 for prefixes up to /30. The first usable host is the network address plus one and the last is the broadcast address minus one.
Worked example: 192.168.1.10/24. The mask is 255.255.255.0. ANDing gives the network 192.168.1.0; ORing the inverted mask gives the broadcast 192.168.1.255. The usable range is 192.168.1.1 through 192.168.1.254 — that is 2⁸ − 2 = 254 hosts.
Common mistakes
- Counting the network and broadcast addresses as assignable hosts — a /24 has 256 addresses but only 254 usable hosts (except /31 point-to-point links).
- Assuming every subnet ends in .255 and starts at .0 — a /26 such as 192.168.1.64/26 runs from .64 (network) to .127 (broadcast).
- Confusing the prefix length with the number of host bits: /24 means 24 network bits and 32 − 24 = 8 host bits.
- Using a /30 (2 hosts) where a /31 (also 2 hosts, per RFC 3021) would halve address consumption on point-to-point links.
Часто задаваемые вопросы
How many usable hosts are in a /24 network?
254. A /24 leaves 8 host bits, giving 2⁸ = 256 addresses, of which the all-zeros address is the network identifier and the all-ones address is the broadcast, leaving 254 assignable host addresses — for example 192.168.1.1 through 192.168.1.254 in 192.168.1.0/24.
What does the /24 in an IP address mean?
It is the CIDR prefix length: the number of leading bits that form the network part of the address. /24 means the first 24 of the 32 bits identify the network, equivalent to the subnet mask 255.255.255.0, and the remaining 8 bits identify hosts within it.
What is a subnet mask?
A subnet mask is the prefix length written as a 32-bit pattern: ones over the network bits and zeros over the host bits. A bitwise AND of an address with its mask yields the network address. For example, mask 255.255.255.192 corresponds to /26 and leaves 6 host bits (62 usable hosts).
Why does a /31 subnet have 2 usable hosts instead of 0?
Under the classic rules a /31 would waste both of its addresses on the network and broadcast identifiers. RFC 3021 (2000) redefined /31 for point-to-point links: since exactly two endpoints exist and no broadcast is needed, both addresses are assignable. This halves address use on router-to-router links compared with /30.
What are private IP addresses?
RFC 1918 reserves three IPv4 blocks for private use: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Addresses in these ranges can be reused inside any organization or home network but are not routed on the public internet; a NAT gateway translates them to public addresses for internet access.
What is the broadcast address used for?
The broadcast address is the highest address in a subnet — the host bits all set to one. A packet sent to it is delivered to every host on that subnet, which services such as DHCP discovery rely on. It cannot be assigned to a device, except that /31 point-to-point links have no broadcast address at all.
Источники
- Mogul J, Postel J. Internet Standard Subnetting Procedure. RFC 950, IETF, 1985.
- Fuller V, Li T. Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan. RFC 4632, IETF, 2006.
- Retana A, White R, Fuller V, McPherson D. Using 31-Bit Prefixes on IPv4 Point-to-Point Links. RFC 3021, IETF, 2000.
- Rekhter Y, Moskowitz B, Karrenberg D, de Groot GJ, Lear E. Address Allocation for Private Internets. RFC 1918, IETF, 1996.