Subnet Calculator
What a CIDR prefix gives you — usable hosts, network and broadcast addresses, the mask, and how many subnets a split produces.
A /24 has 256 addresses and 254 usable, because the first is the network address and the last is broadcast.
How the subnet calculator works
A /24 has 256 addresses and 254 usable, because the first is the network address and the last is broadcast. Every bit you take from the host portion halves the hosts and doubles the subnets.
The arithmetic that trips people is that a /30 gives two usable addresses, not four — which is why point-to-point links use it and why a /31 exists as a special case that gives two by abolishing the network and broadcast addresses entirely.
Formula: hosts = 2^(32 − prefix) − 2
Worked examples
| Inputs | Usable hosts | Note |
|---|---|---|
| A /24 | 254 | 254 usable hosts |
| A /30 point-to-point link | 2 | two usable addresses |
| A /16 | 65,534 | 65,534 hosts |
FAQFrequently asked questions
Why does a /24 have 254 hosts, not 256?
The first address is the network identifier and the last is broadcast. Neither can be assigned to a host.
What is a /30 for?
Point-to-point links. Four addresses, two usable — exactly one for each end.
What is a /31?
A special case defined in RFC 3021 that gives two usable addresses on a point-to-point link by dispensing with network and broadcast entirely.
How many subnets does a split give?
Two to the power of the extra bits. A /24 into /26 borrows two bits, giving four subnets.
Does this work for IPv6?
No — IPv6 has no broadcast address and a vastly larger space, so the arithmetic is different. This is IPv4 only.
Where these figures come from
- IEC 80000-13 — Information science and technology (quantities and units) — the decimal (kB, MB) versus binary (KiB, MiB) prefixes used throughout
- RFC 4632 — Classless Inter-domain Routing (CIDR) — the address-plan arithmetic behind the subnet calculator
- RFC 1918 — Address Allocation for Private Internets — the private ranges the subnet calculator recognises
- NIST SP 800-63B — Digital Identity Guidelines, Authentication — length over composition rules; the basis of the password guidance here
- NIST SP 800-57 Part 1 — Recommendation for Key Management — key-strength comparisons used by the key-space calculator
- NIST — Digital Identity Guidelines (SP 800-63) — US federal authentication standard
Last checked: September 2026. Units follow the SI decimal convention (IEC 80000-13 defines the binary alternatives); network and security figures cite the defining standard.