CIDR, Subnet Mask & Host Range for Any IPv4 Address
Last reviewed: April 2026
| CIDR | Subnet Mask | Addresses | Usable Hosts | Class |
|---|
A subnet calculator computes network addresses, broadcast addresses, host ranges, and the number of usable hosts for a given IP address and CIDR notation or subnet mask. It is essential for network engineers, system administrators, and IT professionals designing and troubleshooting networks.
Subnetting divides a large network into smaller, more manageable segments. Every IPv4 address is 32 bits long, and subnetting determines how those bits are split between the network portion (identifying the subnet) and the host portion (identifying individual devices). The subnet mask defines this boundary — a /24 prefix means the first 24 bits are the network, leaving 8 bits (256 addresses, 254 usable) for hosts. Understanding this is fundamental to network administration, firewall rules, and routing.
CIDR (Classless Inter-Domain Routing) replaced the old classful system (Class A/B/C) in 1993, allowing subnets of any size. CIDR notation writes the network as IP/prefix — for example, 10.0.0.0/8 means the first 8 bits are the network, giving 16.7 million addresses. The key prefixes to know: /8 = 16M addresses (old Class A), /16 = 65K (old Class B), /24 = 256 (old Class C), /30 = 4 addresses (2 usable — standard for point-to-point links), and /32 = single host. For converting between number systems, see the Number Base Converter.
RFC 1918 reserves three ranges for private networks: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. These addresses are not routable on the public Internet and are used behind NAT on home and corporate networks. If your IP starts with 10, 172.16–31, or 192.168, it's private. Everything else is public (with a few exceptions like 127.0.0.0/8 for loopback).
The reference table below shows the most frequently used prefix lengths. In practice, /24 is the workhorse of enterprise networking — 254 usable hosts is enough for most VLANs. /30 and /31 are used for point-to-point router links. Cloud providers often use /16 for VPCs and /20 for subnets within them. Home routers almost universally use /24 (e.g., 192.168.1.0/24).
| CIDR | Subnet Mask | Total Addresses | Usable Hosts | Common Use |
|---|---|---|---|---|
| /32 | 255.255.255.255 | 1 | 1 | Host route |
| /30 | 255.255.255.252 | 4 | 2 | Point-to-point links |
| /28 | 255.255.255.240 | 16 | 14 | Small office |
| /24 | 255.255.255.0 | 256 | 254 | Standard LAN |
| /22 | 255.255.252.0 | 1,024 | 1,022 | Medium campus |
| /20 | 255.255.240.0 | 4,096 | 4,094 | Large site |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Enterprise network |
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | Class A allocation |
Every IPv4 address is a 32-bit number displayed as four octets (e.g., 192.168.1.100). The subnet mask determines which bits identify the network and which identify the host. A /24 mask means the first 24 bits are the network portion and the last 8 bits are the host portion. Within any subnet, the first address (all host bits = 0) is the network address, and the last address (all host bits = 1) is the broadcast address — neither is assignable to a device. This is why a /24 subnet has 256 total addresses but only 254 usable hosts. Each additional bit borrowed from the host portion doubles the number of subnets but halves the hosts per subnet — this tradeoff is the core of subnet planning.
RFC 1918 defines three private address ranges that are not routable on the public internet and can be used freely within any private network. The 10.0.0.0/8 range provides over 16 million addresses and is common in large enterprises. The 172.16.0.0/12 range provides approximately 1 million addresses across 172.16.0.0 to 172.31.255.255. The 192.168.0.0/16 range provides 65,534 addresses and is the default for most home routers and small offices — your home network almost certainly uses 192.168.0.x or 192.168.1.x. These private addresses require Network Address Translation (NAT) to communicate with the public internet, which is why millions of networks worldwide can all use 192.168.1.1 internally without conflict.
Variable Length Subnet Masking (VLSM) allows different subnets within the same network to use different prefix lengths, eliminating the waste of fixed-size subnetting. In a traditional classful design, every subnet must be the same size. With VLSM, a point-to-point WAN link gets a /30 (2 usable addresses), a server VLAN gets a /27 (30 usable), and the main office LAN gets a /23 (510 usable) — all from the same address block. Efficient VLSM allocation starts by assigning the largest subnets first and working down to the smallest, ensuring address blocks remain contiguous and summary routes are possible. This technique is essential for passing the CCNA and any practical network design role.
IPv6 addresses are 128 bits long (versus 32 for IPv4), providing approximately 340 undecillion addresses — enough to assign trillions of addresses to every star in the observable universe. IPv6 subnetting follows similar principles but operates at a vastly different scale. The standard residential allocation is a /48 or /56 prefix, giving each household 65,536 or 256 /64 subnets — each containing 18.4 quintillion host addresses. This abundance eliminates the address conservation pressure that made IPv4 subnetting complex. In IPv6, the convention is that every LAN segment uses a /64 prefix, and subnetting decisions focus on the 16 bits between the provider allocation and the /64 boundary. While IPv4 remains dominant in most networks, IPv6 adoption continues to grow and understanding both protocols is increasingly important.
Home networks typically use a single /24 subnet (192.168.1.0/24) serving up to 254 devices — more than sufficient for most households. Small offices with 10–50 employees often use a /24 as well, sometimes adding a second /24 for guest Wi-Fi isolated from the corporate network. Medium businesses with 100–500 employees usually implement VLANs with separate subnets for departments: /24 for general users, /24 for VoIP phones, /24 for printers and IoT devices, and a /28 for servers. Enterprise networks with thousands of devices require careful IP address planning with documented subnet allocation maps, DHCP scoping, and regular audits to reclaim unused addresses. Cloud environments (AWS, Azure, GCP) add another layer — VPCs and virtual networks require subnet planning that accounts for availability zones, NAT gateways, and peering connections.
→ Memorize the powers of 2. Subnet calculations are all binary. Know that 2⁸ = 256, 2⁷ = 128, 2⁶ = 64, 2⁵ = 32, 2⁴ = 16, 2³ = 8, 2² = 4. Usable hosts = 2^(host bits) − 2.
→ Always subtract 2 for usable hosts. The network address and broadcast address are not assignable. A /24 has 256 addresses but only 254 usable hosts.
→ Document your subnet plan. Even small networks benefit from an IP address spreadsheet tracking which subnets are allocated, what DHCP ranges are configured, and which static addresses are assigned.
See also: Binary Calculator · Hex to RGB · Data Storage Converter · Password Generator
While subnetting divides networks into smaller pieces, supernetting (or CIDR aggregation) combines multiple smaller networks into a single larger block. This is critical for routing efficiency — without supernetting, the global internet routing table would contain millions of individual /24 entries instead of the approximately 950,000 prefixes it currently holds. An ISP that owns 256.0.0.0 through 256.0.255.0 (256 individual /24 networks) can advertise a single /16 route to their upstream provider, reducing routing table entries by 255. Supernetting requires contiguous address blocks aligned on power-of-2 boundaries — you cannot aggregate 192.168.1.0/24 and 192.168.3.0/24 into a single prefix because 192.168.2.0/24 sits between them.
The most common networking problems related to subnetting include devices on different subnets unable to communicate without a router, incorrect subnet masks causing devices to believe they are on different networks when they share the same physical LAN, and DHCP scope misconfiguration that assigns addresses from the wrong subnet. When two devices on the same physical switch cannot ping each other, check that both share the same subnet mask and that their IP addresses fall within the same network range. A device configured with 192.168.1.50/24 cannot communicate directly with 192.168.2.50/24 even if they are connected to the same switch — the different third octets place them on different logical subnets that require a router or Layer 3 switch to bridge. Understanding these fundamentals prevents hours of frustrating troubleshooting.
Subnetting is a fundamental security tool because devices on different subnets cannot communicate without passing through a router or firewall — and that transit point provides an opportunity to inspect and filter traffic. Placing servers on a dedicated subnet (often called a DMZ or demilitarized zone) and restricting access via firewall rules is a foundational network security practice. Guest Wi-Fi should always be on a separate subnet from the corporate or home network, preventing visitors' devices from accessing internal file shares, printers, or other sensitive resources. IoT devices — smart thermostats, cameras, voice assistants — are increasingly placed on their own isolated subnet because they often run outdated firmware with known vulnerabilities. A flat network with no segmentation means any compromised device can potentially reach every other device, making lateral movement trivial for attackers.
→ Run multiple scenarios. Try different inputs to understand how each variable affects the result. This builds practical intuition beyond just getting a single answer.
→ Use accurate inputs for reliable results. The output is only as good as the input. Use measured values rather than rough estimates whenever possible.
→ Bookmark for quick access. Save this page for instant reference — no need to search for it again the next time you need this calculation.
→ Explore related tools. Check the related calculators section below for tools that complement this one — many calculations work best in combination.
See also: Number Base Converter · Data Storage Converter · File Size & Download Calculator · Ohm's Law Calculator · Electrical Power Calculator · Color Converter