Subnet Calculator
Calculate subnet masks, network ranges, and host counts.
Work out an IPv4 subnet from an address and a prefix (like 192.168.1.130/26) or a subnet mask (like 255.255.252.0). The calculator shows the network and broadcast addresses, the first and last usable hosts, how many usable hosts there are, the subnet and wildcard masks, the CIDR notation, the address in binary and hex, its old class and whether it's private, public or reserved. A cheat sheet lists every prefix from /16 to /32 with its mask and host count. Everything is calculated in your browser.
Examples: 10.0.0.0/8 · 192.168.1.130/26 · 172.16.4.1 255.255.252.0
- Network
- 192.168.1.128/26
- Usable hosts
- 62
- Subnet mask
- 255.255.255.192
| Network address | 192.168.1.128 | |
|---|---|---|
| Broadcast address | 192.168.1.191 | |
| First usable host | 192.168.1.129 | |
| Last usable host | 192.168.1.190 | |
| Usable hosts | 62 | |
| Total addresses | 64 | |
| Subnet mask | 255.255.255.192 | |
| Wildcard mask | 0.0.0.63 | |
| CIDR notation | 192.168.1.128/26 | |
| Binary mask | 11111111.11111111.11111111.11000000 | |
| Binary address | 11000000.10101000.00000001.10000010 | |
| Hex address | 0xC0A80182 | |
| IP class | C | |
| Address type | Private (RFC 1918) |
Prefix cheat sheet (/16 to /32)
| Prefix | Mask | Addresses | Usable |
|---|---|---|---|
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /17 | 255.255.128.0 | 32,768 | 32,766 |
| /18 | 255.255.192.0 | 16,384 | 16,382 |
| /19 | 255.255.224.0 | 8,192 | 8,190 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 512 | 510 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | 2 |
| /32 | 255.255.255.255 | 1 | 1 |
Common use cases
- Plan the address ranges for a home or office network
- Check which addresses are usable in a subnet before assigning them
- Get the wildcard mask for a Cisco access list or OSPF statement
- Study for networking exams such as CCNA and Network+
How to use
- Type an IP address with a prefix (10.0.0.5/24) or a mask (10.0.0.5 255.255.255.0).
- Read the network, broadcast and usable host range.
- Copy any value you need.
- Open the prefix cheat sheet to compare subnet sizes.
FAQ
Why are there two fewer usable hosts than addresses?
In a normal subnet the first address names the network and the last is the broadcast address, so neither can be given to a device. A /24 has 256 addresses and 254 usable hosts.
What about /31 and /32?
A /31 has two addresses, both usable on point-to-point links (RFC 3021). A /32 is a single host, often used for loopbacks and routes. The calculator shows these as special cases.
Which addresses are private?
10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are private ranges for local networks (RFC 1918). The address type row tells you which range an address falls in.
Related tools
- IPv4 ValidatorValidate IPv4 address format and structure.
- IP FormatterFormat and validate IP addresses.
- DNS LookupLook up DNS records for domain names.
- WHOIS LookupLook up domain registration information.
- Certificate ViewerDecode SSL/TLS certificates: paste PEM or open a .crt file to see the subject, issuer, expiry date, SANs and…
- URL ParserParse URLs into components (protocol, host, path, etc.).
- MAC Address Vendor LookupIn Reference
- Port Number LookupIn Reference