ScienForge

IP subnet calculator

Find the network address, broadcast address, usable host range and subnet mask for an IPv4 address and CIDR prefix.

e.g. 192.168.1.0

0–32

Network address
192.168.1.0
Subnet mask255.255.255.0
Wildcard mask0.0.0.255
Broadcast address192.168.1.255
Usable host range192.168.1.1 – 192.168.1.254
Total addresses256
Usable hosts254

Standard IPv4 subnetting. /31 and /32 have no usable host range under the classic definition, though /31 is commonly used for point-to-point links.

An IPv4 address and a subnet mask together split a network into a network portion and a host portion. The mask decides where that split falls, which in turn decides how many devices the subnet can hold and where its boundaries sit.

Total addresses = 2^(32 − prefix)

A /24 network has 32 − 24 = 8 host bits, so 2⁸ = 256 total addresses. A /28 has only 4 host bits, giving 16 addresses. Every step down in the host-bit count halves the network’s size.

Why two addresses are unusable

The first address in a subnet, with all host bits set to zero, identifies the network itself and cannot be assigned to a device. The last address, with all host bits set to one, is the broadcast address, reserved for messages sent to every host on the subnet at once. A /24 with 256 total addresses therefore has 254 usable ones.

Reading CIDR notation

The number after the slash is the count of bits fixed as the network portion, counted from the left. /24 means the first three octets are the network and the last octet is free for hosts — exactly what the traditional 255.255.255.0 mask means. CIDR notation and dotted-decimal masks are two ways of writing the identical thing.

CIDRMaskTotal addressesUsable hosts
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/28255.255.255.2401614
/30255.255.255.25242

Why subnet at all

A single flat network of thousands of devices floods itself with broadcast traffic and puts every machine in one failure domain. Splitting an address block into subnets — one per floor, per department, per VLAN — contains broadcast traffic, lets you apply different routing and firewall rules per segment, and uses address space more efficiently than handing every segment a full /24 regardless of size.

The wildcard mask

Cisco access lists and some routing configurations use a wildcard mask instead of a subnet mask — the bitwise inverse of it. Where the subnet mask has a 1, the wildcard has a 0, and vice versa. A /24’s subnet mask of 255.255.255.0 becomes a wildcard of 0.0.0.255. It is easy to transpose the two by mistake, and doing so silently matches the opposite set of addresses from the one intended.