Free · No account · Works in your browser

Subnet Calculator

Enter an IP address and CIDR prefix or subnet mask to calculate network details

Examples:

Results

Network address192.168.1.0
Broadcast address192.168.1.255
First usable host192.168.1.1
Last usable host192.168.1.254
Subnet mask255.255.255.0
Wildcard mask0.0.0.255
CIDR notation192.168.1.0/24

Summary

Prefix length/24
IP classC
Total addresses256
Usable hosts254

CIDR range: 192.168.1.0192.168.1.255

Binary breakdown— dark = network bits, light = host bits

IP address
11000000.10101000.00000001.00000001
Subnet mask
11111111.11111111.11111111.00000000
Network address
11000000.10101000.00000001.00000000
Broadcast address
11000000.10101000.00000001.11111111

How subnetting works

Network address

The first address in a subnet — all host bits set to 0. Identifies the subnet itself, not assignable to a device.

Broadcast address

The last address in a subnet — all host bits set to 1. Sent to all devices in the subnet, not assignable to a device.

First usable host

Network address + 1. The first IP address that can be assigned to a device.

Last usable host

Broadcast address − 1. The last IP address that can be assigned to a device.

Wildcard mask

The inverse of the subnet mask (255 minus each octet). Used in Cisco ACLs, OSPF network statements, and BGP prefix lists.

Usable hosts

2^(32 − prefix) − 2. Subtract 2 because the network and broadcast addresses are reserved.

Frequently asked questions

What is a subnet mask?

A subnet mask is a 32-bit number that divides an IP address into a network portion and a host portion. The network bits are all 1s, the host bits are all 0s. For example, 255.255.255.0 (/24) means the first 24 bits identify the network.

How do I find the network address?

Perform a bitwise AND between the IP address and the subnet mask. The result is the network address. For example: 192.168.1.100 AND 255.255.255.0 = 192.168.1.0.

How do I find the broadcast address?

Set all host bits to 1. The easiest way: take the network address and OR it with the wildcard mask (the inverse of the subnet mask). For a /24 network, the broadcast is the network address with the last octet set to 255.

How many usable hosts does a /24 subnet have?

A /24 subnet has 2^8 = 256 addresses. Subtract 2 (network address and broadcast) = 254 usable hosts. The formula is 2^(32-prefix) - 2 for any prefix length.

What is the wildcard mask?

The wildcard mask is the bitwise inverse of the subnet mask. It is used in Cisco ACLs and OSPF network statements. For 255.255.255.0, the wildcard is 0.0.0.255.