Skip to content
Hopfluent

Free tool

IPv4 subnet calculator

Type an address and prefix length. You get the network, broadcast, mask, wildcard and host range, plus the bits behind the answer.

Format: address/prefix. A space works too.

Try

Network address 192.168.1.128/26. Usable hosts 62.

Network address
Broadcast address
Subnet mask
Wildcard mask
First usable host
Last usable host
Usable hosts
Total addresses
Address type

In binary

192.168.1.130/26

/26

Drag the slider or tap a bit below to move the split.

192
168
1
130

How to read the result

The prefix length after the slash says how many of the 32 bits identify the network. In the binary view those bits are painted blue. Everything to the right is the host part.

  • Network address: your address with every host bit set to 0. It names the subnet.
  • Broadcast address: the same with every host bit set to 1. It reaches every host on the subnet.
  • Usable hosts: 2 to the power of the host bits, minus those two reserved addresses.
  • Subnet mask: the prefix written as an address, with a 1 for each network bit.

Working it out without a calculator

Take 192.168.1.130/26. A /26 mask is 255.255.255.192, so the block size is 256 minus 192, which is 64. Subnets start at .0, .64, .128 and .192. The address .130 falls in the block that starts at .128, so the network is 192.168.1.128, the broadcast is 192.168.1.191 and the usable hosts run from .129 to .190.

That is the whole method. With practice it takes a few seconds.

Subnetting questions

How do I calculate a subnet by hand?+

Find the first mask octet that is not 255 (the interesting octet) and subtract it from 256: that is the block size. In that octet, subnets start at every multiple of the block size. The largest multiple that does not pass your address gives the network address, and one below the next multiple gives the broadcast address.

Why are two addresses in every subnet unusable?+

The address with all host bits set to 0 names the network itself, and the address with all host bits set to 1 is the broadcast address for that subnet. Neither can be assigned to a device (RFC 1122 section 3.2.1.3).

What is a wildcard mask?+

It is the subnet mask with every bit flipped: 0 where the address must match and 1 where it may vary. Access lists and some routing protocols use it. For a /26, the mask is 255.255.255.192 and the wildcard is 0.0.0.63.

Are /31 and /32 valid?+

Yes. A /32 is a single address, used for host routes and loopbacks. A /31 has two addresses, and on a point-to-point link both can be used because no broadcast address is needed (RFC 3021).