# IPv4 Subnet Calculator

Work out the network, broadcast, mask and host range for a CIDR block.

## URL

https://ilham.dev/tools/ipv4-subnet-calculator/

## What It Does

Given an address and a prefix length, work out the network address, broadcast address, netmask, wildcard mask and usable host range, along with the total and usable host counts.

## Features

- Runs in the browser
- No login required

## Input

text input.

## Output

text output.

## Privacy

Processing happens locally in the browser.

No input data is uploaded to ilham.dev.

- Requires login: false
- Requires API key: false
- Stores user data: false


## Examples

- Why is the usable host count two less than the total?
- Can it plan a VLSM layout?




## Questions

### Why is the usable host count two less than the total?

For ordinary IPv4 subnets, the first address is reserved as the network address and the last as broadcast, so the tool subtracts two. **Watch out:** this tool reports `0` usable hosts for `/31` and `/32`. That count is not a full explanation of those special cases: `/31` can be used for a point-to-point link, and `/32` names a single address. Check your network's rules before treating the count as a deployment decision.

### Can it plan a VLSM layout?

Not directly. Use it to check one block at a time, or the range expander to see which CIDR blocks cover an arbitrary range exactly.

