Subnet Calculator
This subnet calculator turns an IPv4 address and a CIDR prefix into a full breakdown. Type the address, pick a prefix like /24, and you'll get the subnet mask, the network and broadcast addresses, the first and last usable host, the host count, and the wildcard mask. It uses bitwise math, so the answers are exact, it's free and private, you won't need an account, and it runs right in your browser, so network planning and study take seconds. You'll see the breakdown the moment you type.
- Mask from CIDR
- Network and broadcast
- Host range
- Host count
- Wildcard
Last updated June 17, 2026 IPv4, CIDR /0 to /32 Reviewed by the Calcowa team
Enter four numbers from 0 to 255 separated by dots. The prefix sets how many bits belong to the network.
How does subnetting work?
An IPv4 address is 32 bits, usually written as four numbers from 0 to 255. Subnetting splits those bits into a network part and a host part, and the CIDR prefix says where the line falls: a /24 keeps the first 24 bits for the network and leaves 8 for hosts. The subnet mask is just those network bits set to 1, so /24 is 255.255.255.0. Line the address up against the mask and the network address appears, with all host bits zeroed; flip the host bits to 1 and you get the broadcast address. Everything between them is assignable, which is why a /24 holds 256 addresses but only 254 usable hosts. You don't have to work the binary by hand, and you won't miscount the hosts, since it's all derived for you. This tool runs that bit math and lays out the mask, the network, the broadcast, the host range, and the wildcard at once, so it's quick whether you're planning a network or studying for a cert.
Reading a subnet, step by step
Here's the quick routine for any address, and it's just three steps:
- 1
Enter the IPType the IPv4 address you are working with.
- 2
Pick the prefixChoose the CIDR, or tap a preset like /24.
- 3
Read the breakdownYou'll get the mask, network, broadcast, and hosts.
Common CIDR prefixes
Here's the mask and usable host count for the prefixes you'll meet most, so it's quick to scan.
| Prefix | Mask | Usable hosts |
|---|---|---|
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /28 | 255.255.255.240 | 14 |
| /30 | 255.255.255.252 | 2 |
Frequently asked questions
You type an IPv4 address and choose a CIDR prefix, like /24, and it works out the rest. It builds the subnet mask from the prefix, lines up the address against it with bitwise math, and reads off the network address, the broadcast address, the first and last usable host, the host count, and the wildcard mask. It all runs in your browser, so you'll see every value update the moment you change the address or the prefix.
CIDR, short for Classless Inter-Domain Routing, writes a subnet as the address followed by a slash and a number, like 192.168.1.0/24. That number is the prefix length, the count of leading bits fixed for the network, so /24 means the first 24 bits are the network and the last 8 are for hosts. A bigger prefix means a smaller subnet with fewer hosts, which is why /30 leaves room for just a couple of devices.
Take 2 to the power of the host bits, which is 32 minus the prefix, then subtract 2 for the network and broadcast addresses that you cannot assign. A /24 has 8 host bits, so 2 to the 8 is 256, minus 2 leaves 254 usable hosts. A /26 has 6 host bits, giving 64 total and 62 usable. The calculator does that for you and shows both the total and the usable count.
The network address is the first address in the subnet, with all host bits set to zero, and it names the subnet itself. The broadcast address is the last address, with all host bits set to one, and a packet sent there reaches every host on the subnet. Neither is assigned to a device, which is why the usable range sits between them, from the network plus one to the broadcast minus one.
A wildcard mask is the inverse of the subnet mask, with the bits flipped, so a mask of 255.255.255.0 becomes a wildcard of 0.0.0.255. Where a 0 in the wildcard means the bit must match, a 1 means anything goes in that spot. Access control lists on routers, especially Cisco gear, use wildcard masks rather than subnet masks, so it's handy to see both side by side here, and you won't have to flip the bits in your head.
Yes, it's completely free, with no sign-up, and it runs right in your browser, so no addresses you enter leave your device. Type an IP, pick a prefix, and read the full breakdown in a tap. Bookmark it for network planning, studying for a certification, configuring a router, or a homework problem, and you'll have an accurate subnet breakdown whenever you need it.
Related tools
More developer tools.
Text, code, and number utilities.
Binary TranslatorText to binary and number bases.
ASCII TableFull ASCII codes, hex, and binary.
Planning a network?
Work it out above, or browse all the dev tools.