# CIDR & subnet calculator

Work out the network, mask, host range and size of any IPv4 CIDR block, and split it into subnets.

## How it works

The prefix length says how many leading bits are the network. The remaining bits number the hosts: a /24 has 256 addresses, of which 254 are usable.

```
addresses = 2^(32 − prefix)
```

## Questions

### Why are two addresses not usable?

The first is the network address and the last is the broadcast address. /31 and /32 are special cases with no reserved addresses.

### How do cloud VPCs differ?

AWS, Azure and Google Cloud reserve a few more addresses in each subnet, usually four or five.

## Related tools

- [Regex tester](https://powertraces.com/tools/regex-tester)
- [Diff checker](https://powertraces.com/tools/diff-checker)
- [YAML ⇄ JSON converter](https://powertraces.com/tools/yaml-json)
- [cURL to code converter](https://powertraces.com/tools/curl-to-code)

[All tools](https://powertraces.com/tools)
