# 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

- [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.
- [Discord Timestamp Generator](https://rankcert.com/tools/discord-timestamp-generator): Pick a date and time and get all 7 Discord timestamp codes - short time, long date, relative and the rest - with a live preview of how each one renders.
- [Pixels to Inches Converter](https://rankcert.com/tools/pixels-to-inches): Convert pixels to inches and centimetres, or inches back to pixels, at 72, 96, 150, 300 or any custom DPI.
- [Barcode Generator](https://rankcert.com/tools/barcode-generator): Generate Code 128, EAN-13, UPC-A, Code 39, ITF-14, MSI and Pharmacode barcodes and download them as PNG. Runs entirely in your browser.
- [Code 128 Barcode Generator](https://rankcert.com/tools/code-128-barcode-generator): Generate a Code 128 barcode from any text or number and download it as a PNG. Full ASCII, automatic subset switching, no signup and nothing uploaded.
- [EAN-13 Barcode Generator](https://rankcert.com/tools/ean-13-barcode-generator): Generate a valid EAN-13 retail barcode, with the check digit calculated for you, and download it as a print-ready PNG. Free, no signup, nothing uploaded.