Subnet Calculator
Enter an IPv4 CIDR block to get its network address, broadcast address, netmask, wildcard mask, usable host range and host count.
How it works
usable hosts = 2^(32 − prefix) − 2 for prefixes /30 and shorter; /31 and /32 are special cases
Sources
- RFC 950 — Internet Standard Subnetting Procedure (1985)
- RFC 4632 — CIDR Address Strategy (2006)
- RFC 1918 — Address Allocation for Private Internets
- RFC 3021 — Using 31-Bit Prefixes on IPv4 Point-to-Point Links
Questions
Why are there two fewer usable hosts?
The first address identifies the network itself and the last is the broadcast address, so neither can be assigned to a device. /31 (point-to-point) and /32 (single host) are exceptions.
What is a wildcard mask for?
It is the bitwise inverse of the subnet mask. Access control lists on routers use wildcard masks to match address ranges, where a 0 means "must match" and a 1 means "ignore".
Does this work for IPv6?
No — this calculator is IPv4 only. IPv6 subnets use a prefix from 0 to 128 and do not reserve a broadcast address, so the arithmetic is different.