Subnet Mask Calculator
Subnet calculator for IPv4: enter an address and a mask or prefix such as /24 to get the network, broadcast address, host range, usable hosts and wildcard mask. How it works
Use the Subnet Mask Calculator
About the Subnet Mask Calculator
A /24 subnet (mask 255.255.255.0) has 256 addresses and 254 usable hosts. For 192.168.1.10/24 the network address is 192.168.1.0, the broadcast address is 192.168.1.255 and hosts run from 192.168.1.1 to 192.168.1.254. This subnet calculator does the same for any IPv4 address with a mask, prefix or wildcard mask, or for CIDR notation such as 10.0.0.0/8 typed in the address field. Given a host count instead, it names the smallest mask that fits.
Subnet masks by prefix length, /8 to /32
| Prefix | Subnet mask | Wildcard mask | Total addresses | Usable hosts |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 |
Usable hosts = total addresses − 2, except /31 (2 hosts on a point-to-point link, RFC 3021) and /32 (a single host).
Special-purpose IPv4 blocks the calculator labels
| Block | Address range | Label shown | RFC |
|---|---|---|---|
| 10.0.0.0/8 | 10.0.0.0 to 10.255.255.255 | Private-Use | RFC 1918 |
| 172.16.0.0/12 | 172.16.0.0 to 172.31.255.255 | Private-Use | RFC 1918 |
| 192.168.0.0/16 | 192.168.0.0 to 192.168.255.255 | Private-Use | RFC 1918 |
| 100.64.0.0/10 | 100.64.0.0 to 100.127.255.255 | Shared Address Space | RFC 6598 |
| 127.0.0.0/8 | 127.0.0.0 to 127.255.255.255 | Loopback | RFC 1122 |
| 169.254.0.0/16 | 169.254.0.0 to 169.254.255.255 | Link Local | RFC 3927 |
| 192.0.2.0/24 | 192.0.2.0 to 192.0.2.255 | Documentation (TEST-NET-1) | RFC 5737 |
| 198.51.100.0/24 | 198.51.100.0 to 198.51.100.255 | Documentation (TEST-NET-2) | RFC 5737 |
| 203.0.113.0/24 | 203.0.113.0 to 203.0.113.255 | Documentation (TEST-NET-3) | RFC 5737 |
| 198.18.0.0/15 | 198.18.0.0 to 198.19.255.255 | Benchmarking | RFC 2544 |
| 240.0.0.0/4 | 240.0.0.0 to 255.255.255.255 | Reserved | RFC 1112 |
Taken from the IANA IPv4 Special-Purpose Address Registry, last updated 2025-10-09. The registry has more entries than these, and the calculator checks an address against all of them. The first three rows are the private ranges. The label is the registry's name for the block; 100.64.0.0/10 is used for carrier-grade NAT, which the calculator says beside the label.
Frequently asked questions
- What is the subnet mask for /24?
- 255.255.255.0. A /24 has 256 addresses and 254 usable hosts. /25 is 255.255.255.128 with 126 hosts, /26 is 255.255.255.192 with 62, and /16 is 255.255.0.0 with 65,534.
- How many usable hosts are in a subnet?
- 2^(32 − prefix) − 2, because the network and broadcast addresses cannot be given to hosts. A /27 has 32 addresses and 30 hosts, and a /30 has 4 addresses and 2 hosts. To go the other way, type a count in Hosts needed: 52 hosts need a /26 (255.255.255.192, wildcard 0.0.0.63, 62 usable), and 14 hosts fit a /28 exactly.
- How do I find the network and broadcast address?
- AND the address with the mask to get the network, then set every host bit to 1 for the broadcast. 10.20.30.40 with /27 is in network 10.20.30.32, with broadcast 10.20.30.63 and hosts 10.20.30.33 to 10.20.30.62.
- How do I split a /24 into smaller subnets?
- Each extra prefix bit halves the block. A /24 splits into 2 subnets of /25 (126 hosts each), 4 of /26 (62 each), 8 of /27 (30 each) or 16 of /28 (14 each). The split table under the result lists these for whatever prefix you enter.
- Why does a /31 show two usable hosts?
- RFC 3021 allows a 31-bit prefix on point-to-point links, where both addresses are read as host addresses and there is no network or broadcast address. 192.168.1.10/31 covers 192.168.1.10 and 192.168.1.11. A /32 is one host address.
- Is 172.32.0.1 a private IP address?
- No. The private 172 block is 172.16.0.0/12, which ends at 172.31.255.255, so 172.31.255.1 is private and 172.32.0.1 is not. The other two RFC 1918 ranges are 10.0.0.0/8 and 192.168.0.0/16. Under the result the calculator names the registry block an address is in, or says it is in none.
Related Tools
View all toolsCIDR Calculator
Enter an IPv4 CIDR block such as 192.168.1.0/24 for its IP range, netmask, broadcast address and usable hosts, split it into subnets or turn a range into CIDR.
JWT Decoder
Paste a JSON Web Token to read its header, its payload and the exp, nbf and iat times in UTC. The signature is shown but not checked: nothing is verified.
URL Parser
Split a URL into protocol, user name, password, host, port, path, query and hash, see each query parameter decoded, and whether the port was written.
Query String to JSON
Paste a query string or a full URL to get JSON: repeated keys and key[] become arrays, + and %20 decode to spaces, with optional nesting and number types.
JSON to Query String
Turn a JSON object into a URL query string: arrays as repeated keys, [], [0], a comma list or JSON, nested objects as user[name], user.name or JSON.
Subnet Mask Cheat Sheet
Subnet mask table for every IPv4 prefix from /0 to /32: dotted mask, wildcard, total and usable hosts, with /31 counted as 2 (RFC 3021) and /32 as 1.