# Subnet Calculator

> A subnet calculator takes an IPv4 address in CIDR notation and returns the network and broadcast addresses, the usable host range, the subnet mask, the wildcard mask and the host count. Enter something like 192.168.1.0/24 and every derived value is computed at once.

Source: https://rankcert.com/tools/subnet-calculator
Free, no signup. Updated: 2026-08-29

## How to use it

1. Enter an address in CIDR form, such as 192.168.1.0/24.
2. Read the network, broadcast and usable host range.
3. Use the wildcard mask when writing ACLs - it is the inverse of the subnet mask.

## CIDR prefix table

Usable hosts is 2^(32-prefix) - 2, because the first address names the network and the last is the broadcast address.

| Prefix | Subnet mask | Addresses | Usable hosts |
| --- | --- | --- | --- |
| /32 | 255.255.255.255 | 1 | 1 (host route) |
| /31 | 255.255.255.254 | 2 | 2 (point-to-point) |
| /30 | 255.255.255.252 | 4 | 2 |
| /29 | 255.255.255.248 | 8 | 6 |
| /28 | 255.255.255.240 | 16 | 14 |
| /27 | 255.255.255.224 | 32 | 30 |
| /26 | 255.255.255.192 | 64 | 62 |
| /25 | 255.255.255.128 | 128 | 126 |
| /24 | 255.255.255.0 | 256 | 254 |
| /23 | 255.255.254.0 | 512 | 510 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |

## Questions

### Why are two addresses unusable?

The first is the network address and the last is the broadcast address. Neither can be assigned to a host, which is why a /24 gives 254 usable addresses rather than 256.

### What about /31 and /32?

A /32 is a single host route. A /31 is a special case defined for point-to-point links where both addresses are usable, since there is no need for a broadcast address.

### What is a wildcard mask?

The bitwise inverse of the subnet mask. Cisco ACLs and OSPF use it instead of a subnet mask, so /24 is 0.0.0.255 rather than 255.255.255.0.

### Which ranges are private?

10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are private. 100.64.0.0/10 is carrier-grade NAT, and 169.254.0.0/16 is link-local.

### How many hosts are in a /24?

254 usable. A /24 spans 256 addresses, minus the network address and the broadcast address. The general formula is 2^(32-prefix) - 2.

### What does /24 actually mean?

The first 24 bits are the network portion, leaving 8 bits for hosts. It is the same information as the mask 255.255.255.0, written more compactly.

### How do I split a network into smaller subnets?

Borrow bits from the host portion. Splitting a /24 into four means moving to /26, giving 64 addresses and 62 usable hosts each.

### How is IPv6 subnetting different?

There is no broadcast address and no scarcity. A /64 is the standard size for any single network regardless of how many devices it holds, and you subnet by taking prefixes shorter than /64.

## Related tools

- [Percentage Calculator](https://rankcert.com/tools/percentage-calculator): Work out X% of Y, what percentage one number is of another, and percentage increase or decrease between two values.
- [Roman Numeral Converter](https://rankcert.com/tools/roman-numeral-converter): Convert numbers to roman numerals and roman numerals back to numbers, with validation that rejects malformed numerals like IIII.
- [Unit Converter](https://rankcert.com/tools/unit-converter): Convert between metric and imperial units for length, weight, volume, time, digital storage and temperature, with exact conversion factors.
- [Epoch Converter](https://rankcert.com/tools/epoch-converter): Convert Unix timestamps to human-readable dates and back, handling both seconds and milliseconds, with UTC, ISO 8601 and local output.
- [Caesar Cipher](https://rankcert.com/tools/caesar-cipher): Shift letters by any amount to encode or decode a Caesar cipher, including ROT13, with all 25 possible shifts shown at once for cracking.
- [Aspect Ratio Calculator](https://rankcert.com/tools/aspect-ratio-calculator): Work out the missing width or height for any aspect ratio, simplify the ratio of any two dimensions, and check the megapixel count.