The formula
How it works
Break an IPv4 address and prefix into its subnet details. Enter an address such as 192.168.1.10 and a prefix like 24, and the calculator returns the netmask, network and broadcast addresses, the usable host range and the host count.
FAQ
What does the prefix /24 mean?
The prefix is how many bits of the address identify the network rather than the host. A /24 fixes the first 24 bits, leaving 8 bits — 256 addresses — for hosts. Smaller prefixes cover more addresses; /16 gives 65,536, while /30 gives just four.
Why are two addresses subtracted from the host count?
Every subnet reserves its first address as the network identifier and its last as the broadcast address, neither of which can be assigned to a device. So a /24 has 256 addresses but 254 usable hosts. Very small blocks like /31 and /32 are special cases used for point-to-point links and single hosts.
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation writes an address and its prefix length together, like 192.168.1.10/24, replacing the older class A/B/C system. It lets networks be sized to whatever number of bits they actually need instead of fixed blocks.
How is the subnet mask related to the prefix?
The subnet mask is just another way of writing the prefix length as four dotted-decimal numbers, such as 255.255.255.0 for /24. Both describe the same boundary between the network and host portions of the address.
What is the difference between a private and a public IP address?
Private ranges — 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 — are reserved for use inside local networks and are not routed on the public internet. Public addresses are globally unique and reachable from anywhere, typically assigned by an ISP or regional registry.
Can this calculator handle IPv6 addresses?
No, this tool works only with IPv4 addresses and prefixes from /0 to /32. IPv6 uses a much larger 128-bit address space with its own notation and subnetting conventions.
How do I split a network into smaller subnets?
Increasing the prefix length — for example moving from /24 to /26 — shrinks each subnet but creates more of them, a process called subnetting. Try different prefix values in the calculator to see how the host count and address ranges change at each size.
About the IP subnet calculator
This calculator takes an IPv4 address and a prefix length and works out the full details of the subnet it belongs to: the subnet mask, the network address, the broadcast address, the range of usable host addresses and how many hosts the block can hold. It is the everyday sum behind planning and troubleshooting networks, replacing error-prone binary arithmetic with an instant, reliable breakdown.
How to use it
Enter an IPv4 address in dotted form, such as 192.168.1.10, and the prefix length as a number from 0 to 32. The calculator shows the netmask, the network and broadcast addresses, the first and last usable host, and the host count. For a 192.168.1.10/24, the network is 192.168.1.0, the broadcast is 192.168.1.255, and there are 254 usable hosts from .1 to .254.
The formula
The prefix defines a netmask with that many leading one-bits. The network address is the IP bitwise-ANDed with the mask, and the broadcast is the network ORed with the inverted mask. The number of usable hosts is , subtracting the network and broadcast addresses. The first host is one above the network address and the last is one below the broadcast.
Where it is used
Network engineers and system administrators use it constantly to design address plans, carve a range into subnets, and check that devices sit in the right network. Students learning networking use it to see how prefixes, masks and host counts relate. Anyone configuring a router, firewall or server benefits from confirming the network and broadcast boundaries before assigning addresses.