# IPv4 Subnet Calculator Guide

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

- Tool: https://ilham.dev/tools/ipv4-subnet-calculator/
- Guide URL: https://ilham.dev/guides/ipv4-subnet-calculator/
- Tool guides index: https://ilham.dev/guides/tools/
- Broader guide: Network Debugging Notes (https://ilham.dev/guides/network-debugging/)

## 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.

## Use the tool

Open https://ilham.dev/tools/ipv4-subnet-calculator/, add the input the tool asks for, run it, and check the output before using it elsewhere.

## Input and output

- Input: text.
- Output: text.
- Category: Network.

## Privacy and processing
Processing happens locally in your browser. This tool does not upload the input to ilham.dev.

## Questions

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

The first address in a subnet is the network address and the last is the broadcast address, and neither can be assigned to a host. The exceptions are /31 and /32, which the tool handles separately.

### 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.