Subnet Calculator

Enter an IP address and CIDR prefix to calculate subnet details

Subnet Details
192.168.1.0/24
network / CIDR
255.255.255.0
subnet mask
254
usable hosts
C
IP class
192.168.1.1
first host
192.168.1.254
last host
Broadcast: 192.168.1.255
Private IP range

How Subnetting Works

Subnetting divides a larger network into smaller, more manageable segments called subnets. Each subnet has a network address, a broadcast address, and a range of usable host addresses in between. The subnet mask determines which portion of an IP address identifies the network and which portion identifies individual hosts.

A CIDR notation like /24 means the first 24 bits of the address define the network, leaving 8 bits for host addresses. With 8 host bits, you get 2⁸ = 256 total addresses, minus 2 (network and broadcast) = 254 usable hosts.

Common Subnet Sizes

CIDRSubnet maskTotal IPsUsable hosts
/30255.255.255.25242
/28255.255.255.2401614
/26255.255.255.1926462
/24255.255.255.0256254
/22255.255.252.01,0241,022
/20255.255.240.04,0964,094
/16255.255.0.065,53665,534

Network vs Host Portions

Every IP address is 32 bits. The subnet mask splits these bits into two parts: network bits (identify the subnet) and host bits (identify individual devices). All devices on the same subnet share the same network portion. The network address has all host bits set to 0, and the broadcast address has all host bits set to 1. Neither can be assigned to a host.

Private IP Address Ranges

ClassRangeCIDRTotal addresses
A10.0.0.0 – 10.255.255.25510.0.0.0/816,777,216
B172.16.0.0 – 172.31.255.255172.16.0.0/121,048,576
C192.168.0.0 – 192.168.255.255192.168.0.0/1665,536

Frequently Asked Questions

What is a subnet mask?

A subnet mask is a 32-bit number that separates the network portion of an IP address from the host portion. In dotted decimal notation, 255.255.255.0 means the first 24 bits are network and the last 8 bits are host. In CIDR notation, this is written as /24.

How many hosts can a /24 subnet support?

A /24 subnet has 256 total addresses. Subtract 2 for the network address (first) and broadcast address (last), leaving 254 usable host addresses.

What is the difference between /24 and /25?

A /24 provides 254 usable hosts. A /25 splits that in half, providing 126 usable hosts per subnet. Each additional CIDR bit halves the number of available hosts.

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) notation uses a slash followed by a number to indicate how many bits of the IP address are used for the network portion. /24 means 24 network bits and 8 host bits.

Why do I lose 2 addresses in every subnet?

The first address is the network address (used to identify the subnet) and the last address is the broadcast address (used to send data to all hosts on the subnet). Neither can be assigned to a device.

Related Calculators

Scroll to Top