Skip to main content
BytesProbe
Probe. Diagnose. Secure.

Network Tools

IPv4 Subnet Calculator

Work out the mask, network and broadcast addresses, usable host range and block size for any IPv4 prefix. Private, loopback and reserved ranges are all accepted: this is arithmetic, and nothing is sent anywhere.

Host bits are fine: 10.135.101.1 reports the 10.135.101.0 network. A pasted 10.0.0.0/24 works too.

/24

Notes

  • Nothing is queried or sent: the answer is computed from the numbers you enter.
  • Private, loopback and reserved ranges are all valid input here.
  • A /31 is a point-to-point link and a /32 is a single host, so neither has a broadcast address.

About the IPv4 subnet calculator

Subnetting is arithmetic on a 32-bit number, and the arithmetic is easy to get wrong under pressure — during a change window, on a call, or while reading somebody else's addressing plan. This works the numbers out so you can check an assumption rather than trust one.

What this checks

An IPv4 address and a prefix length between 0 and 32. The prefix is the count of leading 1 bits in the subnet mask, so a /24 is twenty-four network bits and eight host bits, and the mask is 255.255.255.0. From those two numbers everything else follows: the network and broadcast addresses at each end of the range, the first and last addresses you can actually assign, the wildcard mask that access lists and OSPF use, and how many subnets of that size tile the address space. Host bits set in the address are not an error — entering 10.135.101.1/24 reports the 10.135.101.0/24 network, because that is the subnet the address belongs to. Nothing is looked up or sent anywhere, which is why private, loopback and reserved ranges are all accepted here while the other tools on this site refuse them.

How to read the results

The network address is the first address in the range, with every host bit zero; it names the subnet and is not assignable. The broadcast address is the last, with every host bit set, and reaches every host at once. Everything between them is usable, which is why a /24 holds 254 hosts rather than 256. Usable hosts is 2 to the power of the host bits, minus those two. The block size is how far apart consecutive subnets of this size sit in the octet the prefix falls in: a /26 has a block size of 64, so the networks run .0, .64, .128 and .192. The wildcard mask is the mask inverted, 0 where the mask has 1. The binary rows show why: the mask's run of ones is the boundary, and you can read the split straight off it.

Common fixes

If a host cannot reach its gateway, check the gateway actually falls inside the subnet you calculated — a mask typed as /24 on one device and /25 on another puts them in different networks while the addresses still look neighbourly. If two subnets will not route between each other, check their ranges do not overlap: a /23 starting at .0 covers the .1 network entirely, which is the usual cause of a block of addresses that intermittently answers from the wrong device. If an access list is not matching, check whether it wants a wildcard or a subnet mask; Cisco ACLs take the wildcard, and entering 255.255.255.0 where 0.0.0.255 belongs matches nothing. And if you are running out of addresses in a /30 point-to-point link, a /31 does the same job in half the space on any modern platform.

Frequently asked

Why does a /31 show two usable hosts instead of none?
The usual rule subtracts the network and broadcast addresses, which for a two-address block would leave zero and make the prefix useless. RFC 3021 does away with that on point-to-point links, where there is nothing to broadcast to: both addresses are assignable, one at each end. Every current router and switch platform supports it, and it halves the address consumption of a network full of /30 links. The same reasoning gives a /32 one usable address rather than a negative number: it is a host route, not a subnet.
What does "total networks of this size" actually count?
How many subnets of that prefix length exist in the whole IPv4 address space — 2 to the power of the network bits. A /24 gives 16,777,216 of them, and a /0 gives exactly one, because a /0 is the entire address space. It is a sense-check on the scale of a prefix rather than a count of anything in your own network. If you want to know how many subnets you can cut your own block into, divide: a /16 split into /24s gives 2 to the power of 8, which is 256.