IP Subnet Calculator
Enter an IPv4 address and a CIDR prefix or netmask to see its network, broadcast address, host range and number of usable hosts. This calculator supports IPv4 only; IPv6 is not included.
Result
- Broadcast address
- 192.168.1.255
- Netmask
- 255.255.255.0
- Wildcard mask
- 0.0.0.255
- First usable host
- 192.168.1.1
- Last usable host
- 192.168.1.254
- Usable hosts
- 254
- Total addresses
- 256
- Address type
- Private (RFC 1918)
- Netmask in binary
- 11111111.11111111.11111111.00000000
How a subnet is calculated
The prefix says how many leading bits of the address identify the network. The network address is the IP address with all host bits set to 0, and the broadcast address has all host bits set to 1. The wildcard mask is the netmask with its bits flipped.
The usable hosts lie between the network and broadcast addresses, so a subnet holds 2 to the power of the host bits, minus two. Two exceptions apply: a /31 point-to-point link (RFC 3021) has two usable addresses, both ends of the range, and a /32 is a single host, where the network, broadcast and host address are the same.
Formulas used
Network = IP AND Netmask
Broadcast = Network OR Wildcard
Total addresses = 2^(32 − prefix)
Usable hosts = 2^(32 − prefix) − 2 (/31: 2, /32: 1) Worked example
The address 192.168.1.10 with a /24 prefix:
- Netmask: 255.255.255.0; wildcard: 0.0.0.255
- Network: 192.168.1.10 AND 255.255.255.0 = 192.168.1.0
- Addresses: 2^8 = 256, so 254 usable hosts from .1 to .254
192.168.1.10/24 is in network 192.168.1.0/24 with 254 usable hosts.
Assumptions and limits
- Only IPv4 is supported; IPv6 is not included.
- Octets with leading zeros are rejected because some systems read them as octal.
- Netmasks must be contiguous (all 1 bits first).
- For /31 and /32 the first and last host follow RFC 3021 and single-host conventions; some older equipment may not accept /31 links.