Subnet Calculator

Calculate all subnet details from CIDR notation

Enter an IP address with CIDR prefix (e.g., 192.168.1.0/24) to calculate the network address, broadcast address, subnet mask, first and last usable host, and total number of hosts.

How Subnet Calculation Works

A subnet is a logical subdivision of an IP network. The CIDR notation (e.g., 192.168.1.0/24) specifies the network address and the number of bits used for the network portion.

The subnet mask is derived from the CIDR prefix: it consists of the prefix length in 1-bits followed by 0-bits. For /24, the mask is 255.255.255.0 — 24 ones and 8 zeros.

The network address is found by performing a bitwise AND of the IP address with the subnet mask. The broadcast address is found by setting all host bits to 1.

Usable host addresses range from the network address + 1 to the broadcast address - 1. The total number of addresses is 2(32 - prefix).

Frequently Asked Questions

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) is a method for specifying IP networks, e.g. 192.168.1.0/24. The number after the slash indicates the number of network bits (prefix length). The smaller the number, the larger the network.

What is the difference between usable and total hosts?

The total number of hosts equals 2^(32-prefix). Of these, the network address (first IP) and broadcast address (last IP) are reserved. Usable hosts are therefore total minus 2. For /31 and /32 networks, there are no usable hosts in the classical sense.

What is a subnet mask?

The subnet mask separates the network portion from the host portion of an IP address. It consists of 32 bits where network bits are set to 1 and host bits to 0. For /24, the mask is 255.255.255.0 (24 ones followed by 8 zeros).

What is a broadcast address?

The broadcast address is the last IP address in a subnet. Packets sent to this address are delivered to all hosts in the network. It is calculated by setting all host bits to 1.

Can I enter IPs that are not the network address?

Yes. The tool automatically normalizes the input to the correct network address. For example, entering 192.168.1.50/24 will calculate the network address 192.168.1.0.