CIDR Subnetting Calculator: Hosts, Subnet Mask & CIDR Table
Enter a CIDR prefix (/24, /26, /30…) and get the subnet mask, usable hosts and a full CIDR-to-mask table. /24 = 254 hosts, mask 255.255.255.0. Free, instant, no signup.
See step-by-step calculation
When to use this calculator
- Designing LAN segments for an office: choosing /24 (254 hosts) vs /23 (510 hosts) to avoid wasting addresses while leaving room for growth.
- Configuring AWS VPC subnets: AWS reserves 5 addresses per subnet (not 2), so a /28 gives only 11 usable hosts instead of the standard 14.
- Allocating IP blocks to ISP customers: a /29 (6 usable hosts) for a small business, a /26 (62 hosts) for a medium site, a /22 (1,022 hosts) for a campus.
- Splitting a /22 into smaller subnets for VLAN segmentation: verifying how many /26 subnets fit (16) and how many hosts each carries (62).
CIDR IPv4 Prefix Reference Table
| CIDR | Subnet Mask | Usable Hosts | Equivalent /24 blocks | Common Use |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 | 65,536 /24s | Large ISP / Class A legacy |
| /16 | 255.255.0.0 | 65,534 | 256 /24s | Enterprise campus / AWS VPC max |
| /20 | 255.255.240.0 | 4,094 | 16 /24s | Large office, cloud region subnet |
| /22 | 255.255.252.0 | 1,022 | 4 /24s | University building / data center rack |
| /23 | 255.255.254.0 | 510 | 2 /24s | Medium office LAN |
| /24 | 255.255.255.0 | 254 | 1 /24 | Standard LAN segment |
| /25 | 255.255.255.128 | 126 | ½ /24 | Split LAN (wired vs. wireless) |
| /26 | 255.255.255.192 | 62 | ¼ /24 | Department VLAN |
| /27 | 255.255.255.224 | 30 | ⅛ /24 | Small team / IoT segment |
| /28 | 255.255.255.240 | 14 | 1/16 /24 | Printer/server cluster |
| /29 | 255.255.255.248 | 6 | 1/32 /24 | Small branch office |
| /30 | 255.255.255.252 | 2 | 1/64 /24 | Point-to-point link |
| /31 | 255.255.255.254 | 2 (RFC 3021) | 1/128 /24 | P2P link, no broadcast |
| /32 | 255.255.255.255 | 1 (host route) | 1/256 /24 | Loopback / static host route |
Fuente: IETF RFC 4632 (CIDR) y RFC 3021 (prefijos /31). Fórmula: hosts utilizables = 2^(32−prefijo) − 2, excepto /31 (RFC 3021) y /32.
How it works
How It's Calculated
CIDR subnetting is based on two core formulas derived from the 32-bit IPv4 address space:
Host bits = 32 − prefix_length
Total addresses = 2 ^ host_bits
Usable hosts = 2 ^ host_bits − 2 ← subtract network & broadcast
Subnet mask = 0xFFFFFFFF << host_bits → converted to dotted-decimal
/24 subnets = 2 ^ (prefix_length − 24) (only when prefix ≥ 24)
OR 1 / 2 ^ (24 − prefix_length) expressed as a fraction (prefix < 24)Example — /26:
11111111.11111111.11111111.11000000 → 255.255.255.192Example — /22:
11111111.11111111.11111100.00000000 → 255.255.252.0Example — /30:
---
CIDR Prefix → Subnet Mask → Hosts Reference Table
This is the single table most engineers keep on a sticky note. Find your prefix on the left; read off the mask and how many devices it holds.
| CIDR | Subnet Mask | Usable Hosts | /24 Equivalent | Common Use |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 | 65,536 /24s | Large ISP / Class A legacy |
| /16 | 255.255.0.0 | 65,534 | 256 /24s | Enterprise campus / AWS VPC max |
| /20 | 255.255.240.0 | 4,094 | 16 /24s | Large office, cloud region subnet |
| /22 | 255.255.252.0 | 1,022 | 4 /24s | University building / data center rack |
| /23 | 255.255.254.0 | 510 | 2 /24s | Medium office LAN |
| /24 | 255.255.255.0 | 254 | 1 /24 | Standard LAN segment |
| /25 | 255.255.255.128 | 126 | ½ /24 | Split LAN (wired vs. wireless) |
| /26 | 255.255.255.192 | 62 | ¼ /24 | Department VLAN |
| /27 | 255.255.255.224 | 30 | ⅛ /24 | Small team / IoT segment |
| /28 | 255.255.255.240 | 14 | 1/16 /24 | Printer/server cluster |
| /29 | 255.255.255.248 | 6 | 1/32 /24 | Small branch office |
| /30 | 255.255.255.252 | 2 | 1/64 /24 | Point-to-point link |
| /31 | 255.255.255.254 | 2* | 1/128 /24 | P2P (RFC 3021, no broadcast) |
| /32 | 255.255.255.255 | 1 (host route) | 1/256 /24 | Loopback / static host route |
> /31 special case: RFC 3021 (2000) allows /31 for point-to-point links without a network/broadcast address, giving 2 usable host addresses despite the formula yielding 0.
---
Typical Cases
Case 1: Standard Office LAN (/24)
A small company needs one subnet for 180 employees. A /24 provides 254 usable addresses — enough headroom without wasting a full /23 (510 hosts). Subnet mask: 255.255.255.0. Network: 192.168.1.0/24, hosts range 192.168.1.1–192.168.1.254, broadcast 192.168.1.255.
Case 2: AWS VPC Subnet Planning (/26)
An engineer creates a public subnet in us-east-1a. AWS reserves 5 addresses (network, router, DNS, future use ×2, broadcast), so a /26 yields 59 usable IPs (not 62). For 100 EC2 instances, a /25 (123 usable in AWS) is the right pick.
Case 3: ISP Backbone Point-to-Point (/30)
A router-to-router link between two ISP PoPs uses /30 (255.255.255.252): 4 total addresses, 2 usable. IP A = x.x.x.1, IP B = x.x.x.2, broadcast = x.x.x.3. No wasted space, no routing overhead.
---
Common Errors
1. Forgetting to subtract 2 from total addresses. Every subnet loses the network address (all host bits = 0) and the broadcast address (all host bits = 1). A /28 has 16 total addresses but only 14 usable hosts.
2. Confusing prefix length with host count. /24 does NOT mean 24 hosts — it means 24 network bits, leaving 8 host bits → 254 hosts. A common beginner error that leads to undersized subnets.
3. Ignoring cloud provider reservations. AWS, Azure, and GCP each reserve 5 addresses per subnet (not 2 like standard IPv4), so always subtract 5 instead of 2 when sizing cloud subnets.
4. Using the wrong mask for VLANs. Entering 255.255.255.0 when you need 255.255.255.128 (/25) splits the subnet incorrectly; hosts on the upper half (x.x.x.128–x.x.x.254) become unreachable from the lower half without a router.
5. Treating /31 and /32 as unusable. /31 is valid for point-to-point links (RFC 3021); /32 is the standard notation for host routes and loopback addresses — both are actively used in production networks.
---
Related Calculators
Worked Example — /26
Frequently asked questions
How many usable hosts are in a /24 subnet?
What does the /n number in CIDR notation actually mean?
Why do we subtract 2 from the total host count?
How do I convert a CIDR prefix to a subnet mask?
11111111.11111111.11111111.11000000 → 255.255.255.192. Alternatively, the last non-255 octet value = 256 − (2^host bits in that octet).What is the difference between /24 and /25?
How many hosts does a /26 subnet have?
When should I use a /30 vs. a /31 for point-to-point links?
How does AWS subnet sizing differ from standard IPv4?
What is the largest and smallest valid CIDR block in IPv4?
How many /26 subnets can I carve out of a /22?
Sources & references
Methodology & trust
Calculadora de tecnología revisada por el equipo editorial de Hacé Cuentas, contrastada con RFC 4632 – Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan (IETF / RFC Editor), según nuestra política editorial y metodología.
Última revisión: June 20, 2026. Los parámetros se verifican periódicamente con las fuentes citadas.
Calculations run 100% in your browser. We do not store or transmit your data.
Indicative results. For critical decisions, consult a professional.
Rodríguez, M. (2026). CIDR Subnetting Calculator: Hosts, Subnet Mask & CIDR Table. Hacé Cuentas. https://hacecuentas.com/cidr-subnetting-calculator
Contenido bajo licencia CC-BY 4.0 — reutilizable citando la fuente con enlace a Hacé Cuentas.