IP Subnet Calculator
Compute network, broadcast and usable hosts from an IPv4 address and prefix.
Input Data
IPv4 位址,例如 192.168.1.0。
CIDR 前綴 /0–/32。
Results
192.168.1.0
192.168.1.255
255.255.255.0
0.0.0.255
254
Network 192.168.1.0 / 192.168.1.255; usable 192.168.1.1–192.168.1.254 (254)
At a glance:The mask follows the prefix; network = IP & mask; broadcast = network | ~mask; usable hosts = 2^(32−prefix) − 2 (except /31, /32).
Formula
mask = ~0 << (32 − prefix)
network = IP & mask
broadcast = network | ~mask
hosts = 2^(32−prefix) − 2
How to Use
- Enter an IPv4 address and prefix length.
- Read network, broadcast, mask and host count.
FAQ
What does /24 mean?
The first 24 bits are network; the last 8 are host, giving about 254 usable addresses.
Why subtract 2 from hosts?
Network and broadcast addresses are reserved; /31 and /32 follow different rules.
Related Tools
References
Content review: Calculatorism Science Team.