IP Subnet Calculator
Use this IP Subnet Calculator to calculate IPv4 network address, broadcast address, usable host range, subnet mask, wildcard mask, CIDR prefix, total addresses, usable hosts, binary IP, IP class, private/public status, and subnet splitting. It is designed for students, network engineers, developers, cybersecurity learners, cloud administrators, and anyone learning IPv4 subnetting.
Calculate IPv4 Subnet Details
Enter an IPv4 address and CIDR prefix, or use the other tabs to convert masks, calculate required host prefix, or split a network into smaller subnets.
What Is an IP Subnet Calculator?
An IP Subnet Calculator is a networking tool that calculates the details of an IPv4 network from an IP address and a subnet prefix. It helps determine the network address, broadcast address, first usable host, last usable host, subnet mask, wildcard mask, total number of addresses, usable host count, and binary representation of the address and mask. Subnet calculators are useful because IPv4 subnetting is built on binary math, and doing the conversion manually can be slow or error-prone.
IPv4 addresses look simple because they are written in dotted decimal format, such as 192.168.1.25. Behind that readable form, each address is a 32-bit binary number. Subnetting divides those 32 bits into a network portion and a host portion. The network portion identifies the subnet. The host portion identifies addresses inside that subnet. CIDR notation, such as /24, tells how many of the 32 bits belong to the network portion.
This calculator is designed for practical learning and day-to-day network planning. A student can use it to understand how subnet masks work. A cloud engineer can use it to plan VPC or subnet ranges. A developer can use it when configuring internal services. A cybersecurity learner can use it to understand address ranges during lab work. A network administrator can use it to verify gateway ranges, DHCP pools, and address allocation.
The tool includes four modes. The Subnet Lookup mode calculates a full IPv4 subnet report from an IP address and CIDR prefix. The Mask / CIDR Converter mode converts a subnet mask such as 255.255.255.0 into CIDR notation and wildcard mask. The Hosts → CIDR mode finds the smallest prefix that can support a required number of usable hosts. The Split Network mode divides a larger network into smaller equal-size subnets and displays the first subnet ranges.
How to Use the IP Subnet Calculator
Use the Subnet Lookup tab when you already know an IP address and a CIDR prefix. Enter the IP address in dotted decimal format, such as 192.168.1.25, and choose a prefix such as /24. The calculator will show the network address, broadcast address, usable host range, subnet mask, wildcard mask, total addresses, usable hosts, IP class, and whether the IP is private or public.
Use the Mask / CIDR Converter tab when you have a subnet mask and want to know its prefix. For example, 255.255.255.0 converts to /24. The calculator also shows the wildcard mask, which is often used in network access control and routing configurations. If you choose a CIDR prefix instead, the calculator can show the matching subnet mask directly.
Use the Hosts → CIDR tab when you know how many usable devices a subnet must support. Enter the number of usable hosts, such as 50, and the calculator returns the smallest subnet that supports at least that number of hosts. This is useful for planning office networks, lab environments, cloud subnets, VLANs, IoT networks, or classroom examples. For normal IPv4 LAN subnetting, two addresses are reserved in each subnet: the network address and the broadcast address.
Use the Split Network tab when you need to divide a larger block into smaller equal-size subnets. Enter the parent network, original prefix, new subnet prefix, and how many subnet rows to display. For example, splitting 192.168.10.0/24 into /27 networks creates eight subnets, each with 32 total addresses and 30 usable host addresses.
IP Subnet Calculator Formulas
IPv4 uses 32-bit addresses. A CIDR prefix \/n means that the first \(n\) bits identify the network and the remaining bits identify hosts.
The two-address subtraction applies to most normal IPv4 subnets because one address identifies the network and one address identifies broadcast. The calculator handles edge cases. A /31 network is commonly used for point-to-point links and has two usable point-to-point addresses in modern practice. A /32 represents a single host route and has one address.
CIDR Notation Explained
CIDR stands for Classless Inter-Domain Routing. In practical subnetting, CIDR notation writes an IP network as an address followed by a slash and prefix length, such as 10.0.0.0/16, 172.16.5.0/24, or 192.168.1.64/26. The prefix length tells how many leading bits are fixed as the network portion.
A shorter prefix means a larger network. For example, /16 has 16 network bits and 16 host bits, so it contains \(2^{16}\), or 65,536, total addresses. A longer prefix means a smaller network. A /28 has only 4 host bits, so it contains \(2^4=16\) total addresses. In most normal subnetting situations, 14 of those are usable host addresses.
CIDR replaced older classful thinking for most modern network planning. Older IP classes still appear in education and some terminology, but modern routing and subnetting rely on CIDR. The calculator still displays IP class as an educational reference, but the actual subnet size is determined by the selected prefix.
Subnet Masks and Wildcard Masks
A subnet mask is the dotted decimal form of the network-bit pattern. For example, a /24 prefix means the first 24 bits are 1 and the last 8 bits are 0. Written in decimal, that mask is 255.255.255.0. A /26 mask is 255.255.255.192, because the first two bits of the final octet are network bits and the remaining six bits are host bits.
A wildcard mask is the inverse of the subnet mask. Where the subnet mask has 1 bits, the wildcard has 0 bits. Where the subnet mask has 0 bits, the wildcard has 1 bits. For example, 255.255.255.0 has wildcard 0.0.0.255. Wildcard masks are commonly seen in access control lists, routing filters, and network matching rules.
| CIDR | Subnet Mask | Wildcard Mask | Usable Hosts |
|---|---|---|---|
| /24 | 255.255.255.0 | 0.0.0.255 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 14 |
| /30 | 255.255.255.252 | 0.0.0.3 | 2 |
Network Address, Broadcast Address, and Usable Hosts
The network address is the first address in a subnet. It identifies the subnet itself and is not normally assigned to a host in traditional IPv4 networks. The broadcast address is the last address in the subnet. It is used to represent all hosts in that subnet and is also not normally assigned to a device. The addresses between the network and broadcast addresses form the usable host range.
For example, in 192.168.1.25/24, the network is 192.168.1.0 and the broadcast address is 192.168.1.255. The usable host range is 192.168.1.1 through 192.168.1.254. The total address count is 256, and the normal usable host count is 254.
In smaller networks, address planning becomes tighter. A /30 network contains only four total addresses: one network address, two usable host addresses, and one broadcast address. A /31 is a special case often used for point-to-point links, where both addresses may be usable under modern point-to-point assumptions. A /32 represents one exact host address or route.
Private vs Public IP Addresses
Private IPv4 addresses are reserved for internal networks and are not routed directly on the public internet. The most common private ranges are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. These ranges are heavily used in homes, offices, labs, schools, data centers, cloud networks, and internal corporate systems.
Public IPv4 addresses are globally routable when properly assigned and routed by internet providers and network operators. Public addresses must be managed carefully because IPv4 address space is limited. Many networks use private addresses internally and use NAT, proxies, load balancers, or gateways to reach public internet services.
This calculator labels whether the entered IP is private, loopback, link-local, multicast, reserved, or public-style unicast. This classification helps users understand whether an address is meant for internal use, testing, automatic local configuration, multicast, or general internet routing context.
Subnetting Examples
Example 1: calculate 192.168.1.25/24. A /24 network has 8 host bits because \(32-24=8\). The total number of addresses is:
The usable host count is:
The network is 192.168.1.0, broadcast is 192.168.1.255, and usable range is 192.168.1.1 through 192.168.1.254.
Example 2: calculate 192.168.1.130/26. A /26 network has 6 host bits. The block size is \(2^6=64\). In the final octet, subnet blocks begin at 0, 64, 128, and 192. Since 130 falls inside the 128 block, the network is 192.168.1.128. The broadcast address is 192.168.1.191, and usable hosts are 192.168.1.129 through 192.168.1.190.
Example 3: find a subnet for 50 hosts. The subnet must provide at least 50 usable addresses. A /27 provides 30 usable hosts, which is too small. A /26 provides 62 usable hosts, which is enough. Therefore, the smallest normal subnet for 50 usable hosts is /26.
IP Subnetting Best Practices
Start with the number of hosts required, then leave room for growth. A subnet that barely fits today may become painful later when printers, phones, access points, cameras, servers, containers, or lab systems are added. At the same time, avoid making every subnet too large, because large broadcast domains can become harder to manage in traditional LAN designs.
Use consistent address planning. For example, reserve predictable ranges for gateways, infrastructure devices, DHCP pools, static assignments, VPN users, labs, management networks, and cloud services. Consistency makes troubleshooting easier. If every VLAN or subnet follows a similar pattern, administrators can understand the network faster.
Document every subnet. A subnet calculator gives the math, but a strong network plan also needs labels, purpose, gateway, VLAN ID, DHCP scope, DNS rules, firewall rules, route tables, NAT behavior, and ownership. Good documentation prevents overlapping ranges and accidental reuse.
In cloud environments, plan carefully before creating networks. Cloud subnet ranges can be difficult to change after resources are deployed. Leave space for future regions, availability zones, Kubernetes clusters, private endpoints, load balancers, managed databases, and VPN connectivity. Subnet planning is not just math; it is architecture.
IP Subnet Calculator FAQs
What does an IP Subnet Calculator do?
It calculates IPv4 subnet details such as network address, broadcast address, usable host range, subnet mask, wildcard mask, CIDR prefix, total addresses, and usable hosts.
What does /24 mean in IP subnetting?
A /24 prefix means the first 24 bits are network bits and the remaining 8 bits are host bits. It usually gives 256 total addresses and 254 usable host addresses.
How do I calculate usable hosts in a subnet?
For most IPv4 subnets, usable hosts equal \(2^h-2\), where \(h\) is the number of host bits. The two reserved addresses are the network and broadcast addresses.
What is a subnet mask?
A subnet mask identifies which bits of an IPv4 address belong to the network portion and which bits belong to the host portion.
What is a wildcard mask?
A wildcard mask is the inverse of a subnet mask. For example, the wildcard of 255.255.255.0 is 0.0.0.255.
What is the difference between private and public IP addresses?
Private IP addresses are reserved for internal networks, such as 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. Public IP addresses are globally routable when assigned and routed properly.
Can this calculator split a network into subnets?
Yes. Use the Split Network tab, enter the parent network and new subnet prefix, and the calculator will list the first subnet ranges.
Important Note
This IP Subnet Calculator is for educational, planning, and general networking use. For production networks, validate address plans with your routing design, firewall rules, DHCP configuration, cloud provider constraints, organization standards, and qualified network review.


