Subnet Calculator
An IPv4 network is written with a slash and a prefix length, such as 192.168.1.0/24. The prefix sets how many addresses the network holds. This shows that count.
- Free
- Works offline after your first visit
- Saves on this device
- No sign-up
- Updated
How it works
An IPv4 address has 32 bits, and the prefix says how many of them are fixed for the network. The rest give two to the power of the leftover bits in total addresses.
Usable hosts are the total minus two, because the first address names the network and the last is the broadcast address.
Worked example
A network with a prefix of /24 holds 256 addresses, and 254 of them are usable for devices.
Questions
What does the number after the slash mean?
It is how many leading bits identify the network. A bigger number means a smaller network.
Why subtract two?
The first address names the network and the last one is the broadcast address, so neither goes to a device.
What about /31 and /32?
These are special cases. A /31 link between two routers uses both addresses, and a /32 names a single address. This shows the simple count.
More like this
- Buck Converter CalculatorInductor and capacitor sizes for a step-down converter.
- Audio File Size CalculatorMegabytes for a recording of any length.
- mAh to Wh CalculatorWatt-hours from a milliamp-hour rating.
- Computer Electricity Cost CalculatorMonthly cost of running a computer.
- Data Size Unit ConverterGB, GiB, MB and TB side by side.
- dBm to mW ConverterConvert a power level in dBm to milliwatts.