IP Subnet Calculator
Find an IPv4 network address, broadcast address, host range, and address count. Enter an IP address and choose a prefix length or subnet mask; you can also split the subnet.
Find IPv4 Network and Host Addresses
Subnet Formula
Where:
- \(I\) — the IPv4 address represented as a 32-bit number.
- \(p\) — the prefix length, from 0 to 32.
- \(M\) — the subnet mask; \(W\) is its inverse, or wildcard mask.
- \(N\) — the network address; \(B\) is the broadcast address shown by the calculator.
- \(T\) — the total number of addresses in the subnet.
The mask retains the network bits of the IP address. The remaining bits determine the subnet’s address range.
Subnet – Calculation Example
Example: use the default IP address, 192.168.1.10, with the default prefix length, /24, and leave Split subnet set to Do not split.
For /24, the subnet mask is 255.255.255.0 and the wildcard mask is 0.0.0.255.
\[N=192.168.1.10\mathbin{\mathrm{AND}}255.255.255.0=192.168.1.0\]
\[B=192.168.1.0\mathbin{\mathrm{OR}}0.0.0.255=192.168.1.255\]
\[T=2^{32-24}=256,\qquad \text{usable hosts}=256-2=254\]
Result: the subnet is 192.168.1.0/24, with usable host addresses from 192.168.1.1 through 192.168.1.254. It contains 256 total addresses and 254 usable hosts.
How to use the calculator
- Enter an IPv4 address in IP address, such as 192.168.1.10. You can include a CIDR suffix, such as 192.168.1.10/24; that suffix overrides the prefix or mask selected below.
- Choose Subnet format. Select Prefix length to choose a value from /0 to /32, or Dotted subnet mask to enter a contiguous Subnet mask, such as 255.255.255.0.
- Set Split subnet to Do not split for details about the original subnet. To divide it, select Into N equal subnets and enter Number of subnets (N), or select By new prefix length and choose New prefix length.
- Read Subnet Details for the network, address range, masks, and host counts. If you requested a split, inspect Equal subnets for each resulting network and its host range.
What an IPv4 subnet tells you
An IPv4 address has 32 bits. A prefix length specifies how many leading bits identify the network; the remaining bits distinguish addresses within it. CIDR notation combines a network address and prefix, such as 192.168.1.0/24. A dotted subnet mask expresses the same boundary: /24 corresponds to 255.255.255.0. The wildcard mask reverses the mask’s bits, so it is 0.0.0.255 in this example.
Network address is the first address in the calculated range, and Broadcast address is the last. In an ordinary subnet from /0 through /30, the calculator excludes those two endpoints when reporting First usable host, Last usable host, and Usable hosts. Total addresses still includes both endpoints. These figures describe the size of the range, not how many devices are connected or how many addresses your network can actually assign.
IP class describes the entered address using historical classful categories. Modern subnet boundaries come from the selected prefix or mask, not the class. Address type classifies the entered IP against common private and special-use ranges; it does not classify every address in the resulting subnet. A “Public” label only means the IP did not match the common special-use ranges checked here—it does not establish that the address is assigned or reachable.
Splitting a subnet into equal parts
To make \(s\) equal subnets, where \(s\) is a power of two, add \(\log_2(s)\) bits to the original prefix. For example, splitting a /24 into four subnets produces /26 networks. Each /26 contains \(2^{32-26}=64\) total addresses and, under the usual endpoint rule, 62 usable hosts. The four networks begin at 192.168.1.0, 192.168.1.64, 192.168.1.128, and 192.168.1.192.
Alternatively, choose a longer New prefix length. The calculator determines how many equal subnets fit and lists their network address, displayed broadcast address, host range, and usable-host count. A split must fit within the original prefix and produce no more than 256 rows. When entering Number of subnets (N), use a power of two between 2 and 256.
Assumptions and practical limits
- Only IPv4 addresses and contiguous subnet masks are accepted. This calculator does not process IPv6.
- For /31, both addresses count as usable on a point-to-point link under RFC 3021. The field labeled Broadcast address still displays the higher address, but it is not a conventional broadcast address in that use. For /32, the single address counts as one usable host, and the network and displayed broadcast addresses are identical.
- Host counts are mathematical counts. Reserved ranges, routing rules, provider assignments, and local configuration may further restrict which addresses you can use.
The Binary IP and mask result makes the network-bit boundary visible; the Binary Converter can help when examining individual bit values. The Hexadecimal IP and mask result shows each 32-bit value in hexadecimal, which you can explore further with the Hex Converter.
Frequently Asked Questions
How can I calculate an IPv4 subnet by hand without converting every bit?
Find the first mask octet that is not 255, then subtract it from 256 to get the block size. For /27, the mask ends in 224, so blocks in the last octet start every 32 addresses. The address 192.168.1.77 falls in the block starting at 64: its network is 192.168.1.64 and its last address is 192.168.1.95.
What subnet size should I choose for my network?
Choose a subnet with enough usable addresses for your devices plus room to grow. A /28 provides 14 usable addresses, a /27 provides 30, and a /26 provides 62 under the usual host-count rule. Remember to include addresses used by the router, printers, and other equipment. Your organization’s routing and security design may also affect the choice.
How do I convert a CIDR prefix to a dotted-decimal subnet mask?
Write one binary 1 for each prefix bit, fill the remaining positions with 0s, and convert each group of eight bits to decimal. For /21, the first two octets are all 1s, and the third is 11111000. That gives 255.255.248.0. A valid subnet mask cannot switch back to 1s after its first 0.
How can I tell whether two IP addresses are in the same subnet?
Calculate the network address of each IP using the subnet mask configured for that address. If the network addresses match and the devices use the same subnet boundary, they are in the same IP subnet. For example, 192.168.1.10 and 192.168.1.200 are both in 192.168.1.0/24. Matching subnet calculations alone do not guarantee connectivity; VLANs, firewalls, and configuration still matter.
Can two IPv4 subnets overlap?
Yes. For example, 192.168.1.128/25 falls entirely inside 192.168.1.0/24. That relationship is useful when summarizing routes, but assigning overlapping ranges to separate local networks can create ambiguous routing and address conflicts. Before allocating a new subnet, compare its full address range with ranges already assigned, not just its network address.
Is a subnet the same thing as a VLAN or a DHCP range?
No. A subnet is an IP address range defined by a prefix, while a VLAN separates traffic at the network-link layer. A DHCP range is the pool of addresses a DHCP server may hand out and is often only part of a subnet. Networks commonly pair one subnet with one VLAN, but that is a design choice, not a requirement.
Can a device with a private IPv4 address access the internet?
Yes, but its private address is not normally routed across the public internet. A router typically translates its traffic to a public address using NAT; a VPN or proxy can provide another path. A subnet calculation cannot tell you whether that translation or route exists, so check the gateway and network configuration if connectivity fails.