Free IP Subnet Calculator โ IPv4 Network Calculator
Instantly calculate network address, broadcast address, subnet mask, wildcard mask, host range and usable hosts for any IPv4 subnet. Enter an IP address and CIDR prefix to get full subnet details in real time.
Enter an IPv4 address and CIDR prefix (or subnet mask) to calculate subnet details.
What Is Subnetting and Why Does It Matter?
Subnetting is the practice of dividing a single IP network into smaller, more manageable sub-networks called subnets. Originally, the IPv4 address space was divided into fixed classes (A, B, C), but this proved wasteful โ a company needing 300 hosts would need a full Class B block of 65,534 addresses, wasting over 65,000 addresses. Subnetting, formalized through Classless Inter-Domain Routing (CIDR) in the early 1990s, solved this by allowing networks to be subdivided at arbitrary bit boundaries.
In practice, subnetting matters for several reasons. Security: Separate subnets can be isolated with firewalls and access-control lists, so a compromised device in one subnet cannot easily reach devices in another. Performance: Broadcast traffic is contained within a subnet; smaller subnets mean smaller broadcast domains and less congestion. Organization: Departments, floors, services, or environments (production, staging, development) can each have their own subnet, simplifying network management and troubleshooting. IP address conservation: Properly sized subnets avoid allocating hundreds of unused addresses to small teams or point-to-point links.
Every network engineer, system administrator, cloud architect, and DevOps practitioner encounters subnetting regularly. Cloud providers like AWS, Azure, and GCP require you to define VPC subnets before provisioning resources. Docker and Kubernetes use internal subnets for container networking. Home routers create a subnet (usually 192.168.1.0/24) for your local devices. Understanding subnetting is a foundational skill that underpins all of modern networking.
CIDR Notation Explained
CIDR (Classless Inter-Domain Routing) notation represents an IP address and its associated network prefix length in a compact form: IP address / prefix length. For example, 192.168.1.0/24 means the first 24 bits of the address identify the network, and the remaining 8 bits identify hosts within that network.
The prefix length (also called the subnet mask length or CIDR block) ranges from /0 (the entire internet, 4,294,967,296 addresses) to /32 (a single host address). Common values you will encounter:
- /8 โ 16,777,216 addresses. Used for large ISPs, historical Class A allocations.
- /16 โ 65,536 addresses. Common for large enterprise networks, AWS VPCs.
- /24 โ 256 addresses (254 usable). The most common subnet size for office networks and home LANs.
- /25 โ 128 addresses (126 usable). Splits a /24 in half.
- /28 โ 16 addresses (14 usable). Small office segments, cloud subnets.
- /30 โ 4 addresses (2 usable). Point-to-point links between routers.
- /32 โ 1 address. Used for host routes, loopback addresses, firewall rules targeting a single IP.
To convert between CIDR and dotted-decimal subnet mask, recall that a /24 mask has 24 consecutive 1-bits: 11111111.11111111.11111111.00000000 = 255.255.255.0. A /20 mask = 11111111.11111111.11110000.00000000 = 255.255.240.0. The binary representation shown in this calculator makes this relationship explicit.
IPv4 Address Classes (A, B, C)
Before CIDR, the IPv4 address space was divided into fixed classes defined by the first octet of the address. While classful addressing is largely obsolete in modern routing, you will still encounter these class designations in documentation, textbooks, firewall rules, and vendor interfaces.
- Class A (first octet 1โ126): Designed for very large networks. Default mask /8 (255.0.0.0). Examples: 10.0.0.0, 72.0.0.0. The 10.0.0.0/8 private range falls here.
- Class B (first octet 128โ191): Designed for medium-to-large networks. Default mask /16 (255.255.0.0). Examples: 172.16.0.0 (private), 150.0.0.0. The 172.16.0.0โ172.31.255.255 private range falls here.
- Class C (first octet 192โ223): Designed for small networks. Default mask /24 (255.255.255.0). Examples: 192.168.1.0 (private). The entire 192.168.0.0/16 private range is here.
- Class D (first octet 224โ239): Reserved for multicast. Not used for unicast host addressing.
- Class E (first octet 240โ255): Reserved for experimental use.
- Loopback (127.x.x.x): Reserved for the loopback interface. 127.0.0.1 is the canonical localhost address.
The three private IP ranges (RFC 1918) โ 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 โ are not routable on the public internet and are freely usable within private networks. Most home and office networks use 192.168.x.x addresses.
Common Subnet Masks and Their Uses
Selecting the right subnet size is a balance between having enough IP addresses for current and future hosts while avoiding wasteful over-allocation. Here are the most common subnet sizes and their typical applications:
| CIDR | Subnet Mask | Total IPs | Usable Hosts | Typical Use |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | Large ISP, national carrier allocations |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Enterprise WAN, large AWS VPC |
| /20 | 255.255.240.0 | 4,096 | 4,094 | Large campus segment, data centre block |
| /24 | 255.255.255.0 | 256 | 254 | Office LAN, home network, cloud subnet |
| /25 | 255.255.255.128 | 128 | 126 | Half of a /24, medium department |
| /26 | 255.255.255.192 | 64 | 62 | Small department, DMZ segment |
| /27 | 255.255.255.224 | 32 | 30 | Small team, server cluster |
| /28 | 255.255.255.240 | 16 | 14 | Small office, cloud management subnet |
| /29 | 255.255.255.248 | 8 | 6 | Small group of servers, IoT cluster |
| /30 | 255.255.255.252 | 4 | 2 | Point-to-point router links |
| /31 | 255.255.255.254 | 2 | 2 | Point-to-point links (RFC 3021, no network/broadcast) |
| /32 | 255.255.255.255 | 1 | 1 | Host routes, loopback, firewall rules |
When designing a network, a common best practice is to allocate subnets slightly larger than needed โ for example, using a /25 (126 hosts) rather than a /26 (62 hosts) for a department that currently has 50 devices โ to allow for growth without renumbering. Cloud environments like AWS additionally reserve the first four and last IP in each subnet for infrastructure use, reducing usable hosts further.
Frequently Asked Questions
permit ip 10.0.0.0 0.255.255.255 permits any address in the 10.0.0.0/8 range.Related Free Tools
Need a custom tool built for your business?
Get a Free Quote