Subnet Calculator
Work out network, broadcast, host range and usable addresses for any IPv4 block.
About the Subnet Calculator
A prefix length is a count of leading bits that identify the network. /24 means the first 24 bits are fixed and the last 8 vary, giving 256 addresses of which 254 can be assigned — the first is the network address and the last is the broadcast address, and neither goes on a host.
Two prefixes break that rule, and both are shown correctly here rather than reported as having zero or minus one hosts. A /31 has no network or broadcast address at all: RFC 3021 defines it for point-to-point links, where both addresses are usable. A /32 is a single address, which is how you write one specific host in a firewall rule or route.
The wildcard mask is the netmask inverted. Cisco access lists and several routing protocols take that form rather than the netmask, and converting it in your head is a reliable way to make a mistake at two in the morning.
Where both a network and a host portion are given, the address is masked down to its network first — so 192.168.1.130/26 and 192.168.1.128/26 describe the same block, which is usually what you want to confirm.
How it works
Type an address in CIDR form, like 10.0.0.1/24, or with a dotted netmask.
Read off the network, broadcast, host range and address count.
Split the block into smaller subnets if you need to divide it.
Frequently asked questions
- How many hosts are in a /24?
- 256 addresses, 254 of them usable. The first is the network address and the last is the broadcast address; neither can be assigned to a machine.
- Why does a /31 show two usable addresses instead of none?
- Because RFC 3021 says so. A /31 is meant for point-to-point links, where there is no need for a broadcast address and both addresses go on interfaces. Applying the usual minus-two rule would report zero usable hosts, which is wrong.
- What is a wildcard mask?
- The netmask with every bit flipped — 0.0.0.255 where the netmask is 255.255.255.0. Cisco access lists and OSPF take this form, and it is easy to invert incorrectly by hand.
- What is the difference between the network address and the first host?
- The network address identifies the block itself and is always the lowest address in it. The first usable host is the one immediately after. On a /24 that is x.x.x.0 and x.x.x.1 respectively.
- Which address ranges are private?
- 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16, set aside by RFC 1918 for use inside networks. Anything in those ranges is flagged here, along with loopback, link-local and carrier-grade NAT space.
Privacy
Everything happens locally. Your files are read by your own browser, processed on your device, and never uploaded — closing the tab is all it takes to erase them.
Related tools
Code to Image
Turn a code snippet into a shareable image, with syntax highlighting and themes.
Cron Expression Builder
Write a cron schedule, read it back in plain English, and see exactly when it will next run.
CSS Gradient Generator
Build linear, radial and conic CSS gradients visually and copy the code.
CSV to JSON Converter
Convert CSV to JSON and back, with proper quoting, type inference and a table preview.
JSON Formatter
Format, validate and minify JSON with clear error positions.
JWT Decoder
Decode a JSON Web Token's header and payload, and verify an HMAC signature.