IPv4 subnet calculator
Network, broadcast, host range and subnetting for an address with a mask.
In binary
network bits
—
Split into
| # | Subnet | Host range | broadcast |
|---|---|---|---|
Network
—
Mask
—
Host addresses
—
Details
The details appear when the address is set.
Calculated in your browser — nothing is sent to the server
Practice on a machine
Lab “Repair a persistent address”
In a Linux terminal
ip -br addr
# addresses and masks on interfaces
ip route
# which network via which interface
sudo ip addr add 192.168.1.10/24 dev eth0
# add an address until reboot
ipcalc 192.168.1.10/24
# the same calculation (ipcalc package)
Keep in mindThe gateway must be in the same subnet as the machine's address, or the default route via it won't be added.
FAQ
How many hosts are in a /24 subnet?
254: of 256 addresses, the first is the network address and the last is the broadcast. The formula is 2^(32 − prefix) − 2.
What is a wildcard mask?
An inverted mask: 0.0.0.255 matches /24. Cisco ACLs and OSPF settings use it.
Why can't two computers on one network see each other?
Often their masks differ, so they disagree on where the network ends. Compare ip -br addr on
both: the network and broadcast must match.