Subnet Calculator
From an IPv4 address and a CIDR prefix, work out the network address, broadcast address, subnet mask and usable host range.
DeveloperResult
Network address
192.168.1.0/24
- Broadcast address
- 192.168.1.255
- Subnet mask
- 255.255.255.0
- First usable address
- 192.168.1.1
- Last usable address
- 192.168.1.254
- Usable hosts
- 254
- Total addresses
- 256
How does it work?
Enter an IPv4 address and a CIDR prefix (like /24). The tool derives the subnet mask from the prefix, ANDs the address with the mask to get the network address, sets the remaining bits to get the broadcast address, and shows the usable host range in between. /31 and /32 are special cases: per RFC 3021, /31 has no separate broadcast reservation for its two hosts, and /32 addresses a single host.
Formula
Network address = IP AND Mask Broadcast address = Network address OR (NOT Mask) Usable hosts = 2^(32−prefix) − 2 (the ordinary case)
Example
IP address: 192.168.1.0 · Prefix (CIDR, /0–/32): 24 → Network address: 192.168.1.0/24
Similar Tools
Toolbox Get your Toolbox ready.
Star the tools you use most and, with an account, they follow you to every device.
Frequently asked questions
How many hosts does a /24 give me?
2^(32−24) = 256 addresses, minus 2 (network and broadcast) leaves 254 usable hosts.
Why are /31 and /32 different?
/32 addresses a single device, with no network/broadcast split. /31 is specifically reserved by RFC 3021 for two-device point-to-point links and both its addresses are usable; the ordinary network/broadcast rule doesn't apply there.
Does this only support IPv4?
Yes, IPv4 only for now. IPv6 uses a much larger address space and would need a tool of its own.