Subnet Calculator

Enter an IPv4 address and a prefix length (CIDR) to get the full subnet details — network address, broadcast address, usable host range, subnet mask, wildcard mask, and a binary view. Everything is worked out right in your browser.

How it is calculated

The prefix length is turned into a 32-bit subnet mask. For example, /24 becomes 255.255.255.0.

The IP address and the mask are compared bit by bit to find the network address.

All the host bits are set to 1 to find the broadcast address.

The usable host range sits between the network address and the broadcast address.

A /31 is treated as a special 2-address link (as per RFC 3021), and a /32 is a single address — so the usual 'minus 2' rule does not apply to these two.

Formula

Network address: IP AND Subnet Mask

Broadcast address: Network OR (NOT Subnet Mask)

Total addresses: 2 ^ (32 − prefix)

Usable hosts: 2 ^ (32 − prefix) − 2

Frequently asked questions

Why are 2 addresses subtracted from the host count?

The first address in a subnet is the network address itself, and the last one is the broadcast address. Neither can be given to a device. So a /24 has 256 total addresses, but only 254 can actually be used.

What is a wildcard mask?

It is the exact opposite of the subnet mask, bit by bit. It is used in Cisco access lists and OSPF settings, where a 0 means 'this bit must match' and a 1 means 'ignore this bit'.

What is the difference between /24 and 255.255.255.0?

They mean the same thing, written in two different ways. /24 is CIDR notation, meaning the first 24 bits are fixed. 255.255.255.0 is the same value written as a normal subnet mask.