IPv4 Subnet Calculator

From any IPv4 address and CIDR prefix: network, broadcast, netmask, wildcard, first and last host, and usable host count — with /31 and /32 handled the modern way.

Home › IPv4 Subnet Calculator

How to use the ipv4 subnet calculator

The maths

A CIDR prefix /n leaves 32−n host bits, so the subnet holds 2(32−n) addresses. The network address is your IP with all host bits set to 0; the broadcast has them all set to 1. The netmask is n one-bits followed by zeros — for /24, that is 255.255.255.0.

Edge cases done honestly

/32 is a single host. /31 is the RFC 3021 point-to-point special case (2 usable). Everything /30 and shorter reserves network + broadcast, so usable = total − 2.

Example

192.168.1.10/24 lives in network 192.168.1.0, broadcast 192.168.1.255, usable hosts 192.168.1.1 – 192.168.1.254 (254 hosts), netmask 255.255.255.0, wildcard 0.0.0.255.

Frequently asked questions

How many usable hosts are in a /24?

254. A /24 has 256 addresses; the first is the network address and the last is the broadcast address, leaving 254 for devices.

Why does a /31 show 2 usable hosts instead of 0?

On point-to-point links, RFC 3021 allows both addresses of a /31 to be used — there is no broadcast on a two-device link. Older equipment may still treat /31 the classic way.

What is a wildcard mask used for?

It is the inverse of the netmask (255.255.255.255 minus the mask). Cisco ACLs and OSPF statements use wildcard masks to describe which address bits must match.

More free tools

More Free Tool Kits