Calculate IPv4 and IPv6 subnets — network and broadcast address, usable host range, masks, class and address type — from an IP address and prefix.
Enter an address and prefix length (or type it as 192.168.1.10/24) to see the network, broadcast, host range and masks.
| Field | Value |
|---|
| Field | Value |
|---|
AND the IP address with the subnet mask to get the network address; set the host bits to 1 for the broadcast address; usable hosts = 2(32 − prefix) − 2. Example: 192.168.1.10/24 → network 192.168.1.0, broadcast 192.168.1.255, 254 usable hosts.
The IP Subnet Calculator works out everything about an IP network from an address and a prefix length. For IPv4 it returns the network and broadcast addresses, the first and last usable host, the number of hosts, the subnet and wildcard masks, the IP class and type (private, public, loopback and so on), and the address in binary, integer and hex form. For IPv6 it returns the compressed and expanded address, the network, first and last address in the prefix, and the size of the subnet.
Network engineers, students preparing for networking exams, developers configuring cloud networks (VPCs, security groups) and anyone planning a home or office LAN can use it to check subnet boundaries before configuring routers and firewalls. All calculations run in your browser; the addresses you enter are never sent anywhere.
A subnet mask (or prefix length) tells you which bits of an address identify the network and which identify the host.
Some references list /31 and /32 as having 0 usable hosts; modern practice (RFC 3021) uses them as described above.
| Prefix | Subnet mask | Total addresses | Usable hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 1,67,77,216 | 1,67,77,214 |
| /9 | 255.128.0.0 | 83,88,608 | 83,88,606 |
| /10 | 255.192.0.0 | 41,94,304 | 41,94,302 |
| /11 | 255.224.0.0 | 20,97,152 | 20,97,150 |
| /12 | 255.240.0.0 | 10,48,576 | 10,48,574 |
| /13 | 255.248.0.0 | 5,24,288 | 5,24,286 |
| /14 | 255.252.0.0 | 2,62,144 | 2,62,142 |
| /15 | 255.254.0.0 | 1,31,072 | 1,31,070 |
| /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 |
| Class | Address range | Default mask | Hosts per network |
|---|---|---|---|
| A | 1.0.0.0 – 126.255.255.255 | 255.0.0.0 (/8) | 16,777,214 |
| B | 128.0.0.0 – 191.255.255.255 | 255.255.0.0 (/16) | 65,534 |
| C | 192.0.0.0 – 223.255.255.255 | 255.255.255.0 (/24) | 254 |
| D (multicast) | 224.0.0.0 – 239.255.255.255 | — | — |
| E (reserved) | 240.0.0.0 – 255.255.255.255 | — | — |
| CIDR block | Range | Addresses |
|---|---|---|
| 10.0.0.0/8 | 10.0.0.0 – 10.255.255.255 | 16,777,216 |
| 172.16.0.0/12 | 172.16.0.0 – 172.31.255.255 | 1,048,576 |
| 192.168.0.0/16 | 192.168.0.0 – 192.168.255.255 | 65,536 |
| 100.64.0.0/10 | 100.64.0.0 – 100.127.255.255 | 4,194,304 |
| 169.254.0.0/16 | 169.254.0.0 – 169.254.255.255 | 65,536 |
| 127.0.0.0/8 | 127.0.0.0 – 127.255.255.255 | 16,777,216 |
| Prefix | Typical use | Size |
|---|---|---|
| /32 | Typical allocation to an ISP or large organisation | 79,228,162,514,264,337,593,543,950,336 (2^96) |
| /48 | Typical site (company or home) assignment | 2^80 addresses — 65,536 /64 subnets |
| /56 | Common residential assignment | 2^72 addresses — 256 /64 subnets |
| /64 | Standard single LAN subnet | 18,446,744,073,709,551,616 (2^64) |
| /127 | Router-to-router point-to-point link (RFC 6164) | 2 addresses |
| /128 | A single host address | 1 address |
A subnet mask is a 32-bit pattern that separates the network part of an IPv4 address from the host part. 255.255.255.0 means the first 24 bits identify the network and the last 8 bits identify hosts.
/24 is CIDR notation for a prefix length of 24 bits — the same as the mask 255.255.255.0. It leaves 8 host bits, giving 256 addresses and 254 usable hosts.
AND the IP address with the subnet mask to get the network address. Then set all host bits to 1 to get the broadcast address. For 192.168.1.10/24 the network is 192.168.1.0 and the broadcast is 192.168.1.255.
2^(32 − prefix) − 2, because the network and broadcast addresses cannot be assigned to hosts. A /24 has 254; a /26 has 62; a /30 has 2.
The inverse of the subnet mask (each bit flipped). The wildcard for 255.255.255.0 is 0.0.0.255. It is used in router access lists and OSPF configuration.
Private addresses (10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16) are used inside local networks and are not routed on the public internet. Public addresses are globally unique and reachable over the internet.
Classless Inter-Domain Routing writes an address with its prefix length, such as 203.0.113.0/24. It replaced fixed classes A, B and C and lets networks be sized exactly.
A /31 has only two addresses and is used for point-to-point links (RFC 3021); a /32 identifies a single host, such as a loopback or a specific route.
IPv6 addresses are 128 bits, written in hexadecimal. There is no broadcast address, and the standard LAN subnet is a /64 containing 2^64 addresses. Prefix length works the same way as in IPv4.
It is shorthand for one or more consecutive groups of zeros and can appear only once. 2001:db8::1 is the same as 2001:0db8:0000:0000:0000:0000:0000:0001.
No. The Websolindia IP Subnet Calculator runs entirely in your browser; nothing you type is uploaded or stored.