Enter an IPv4 address and its prefix length (the number after the slash, as in /24). See the network and broadcast addresses, the first and last usable host, the netmask and how many hosts the subnet holds.
- Usable host addresses
- –
- Network address
- –
- Broadcast address
- –
- First usable host
- –
- Last usable host
- –
- Netmask
- –
- Wildcard mask
- –
- Network in CIDR notation
- –
- Addresses in the block
- –
Assumptions
- IPv4 only. The prefix length counts the leading 1-bits of the netmask (RFC 4632).
- The all-0s host address names the network and the all-1s address is the broadcast, so neither is a host (RFC 1122).
- A /31 is treated as a point-to-point link with two host addresses (RFC 3021); a /32 is one address.
Checked 29 October 2026 RFC 4632 (BCP 122, 2006): Classless Inter-domain Routing (CIDR), prefix notation and block sizes All sources
How it is calculated
- Addresses in the block = 2^(32 − prefix length)
- Netmask = prefix length 1-bits followed by 0-bits; wildcard mask = its inverse
- Network address = the address with all host bits set to 0; broadcast = all host bits set to 1
- Usable hosts = addresses − 2 (network and broadcast); a /31 has 2 (RFC 3021) and a /32 has 1
Worked example
The address 192.168.1.10 in a /24 subnet.
| You enter | |
|---|---|
| IPv4 address | 192.168.1.10 |
| Prefix length | 24 bits |
| You get | |
| Usable host addresses | 254 |
| Network address | 192.168.1.0 |
| Broadcast address | 192.168.1.255 |
| First usable host | 192.168.1.1 |
| Last usable host | 192.168.1.254 |
| Netmask | 255.255.255.0 |
| Wildcard mask | 0.0.0.255 |
| Network in CIDR notation | 192.168.1.0/24 |
| Addresses in the block | 256 |
The subnet 192.168.1.0/24 has 256 addresses, from 192.168.1.0 to 192.168.1.255. 254 of them can be given to hosts: 192.168.1.1 to 192.168.1.254. Netmask 255.255.255.0.
Questions
Why are there two fewer hosts than addresses?
The first address of a subnet names the network itself and the last is the broadcast address. RFC 1122 says neither may be given to a host, so a /24 has 256 addresses and 254 hosts.
What about /31?
RFC 3021 lets a /31 be used on a point-to-point link, such as between two routers: both addresses are host addresses and there is no broadcast. Older equipment that does not support it may not work on such a link.
Sources and checks
- RFC 4632 (BCP 122, 2006): Classless Inter-domain Routing (CIDR), prefix notation and block sizes
- RFC 1122 (1989), section 3.2.1.3: host-number fields of all 0s and all 1s are not host addresses
- RFC 3021 (Standards Track, 2000): using 31-bit prefixes on IPv4 point-to-point links
Last checked: 29 October 2026. This tool passes 11 automatic tests before every release. How we check our tools
Cite this page
IP Subnet Calculator (IPv4 CIDR, Netmask and Host Range). GlanceDesk Compute. Last checked 29 October 2026. https://glancedeskcompute.com/
Your numbers stay on your device unless you share them.
For planning and learning. Your router or cloud provider may reserve more addresses in a subnet (for gateways or services); check its documentation. Results are estimates for planning and learning. They are not a design check and do not replace a qualified engineer or your local building/electrical code.