🧮 Subnet Calculator

What a subnet calculator does

A subnet calculator takes an IP address written in CIDR notation (for example 192.168.1.0/24) and works out the structure of that network: the network address, the broadcast address, the subnet mask, the range of usable host addresses, and the total number of hosts the subnet can contain. It saves you from doing the binary math by hand.

The number after the slash is the prefix length — how many bits are fixed for the network portion. A larger prefix (like /30) means a smaller network with fewer hosts; a smaller prefix (like /16) means a much larger network.

CIDR cheat sheet (subnet mask & host count)

CIDRSubnet maskUsable hosts
/24255.255.255.0254
/25255.255.255.128126
/26255.255.255.19262
/27255.255.255.22430
/28255.255.255.24014
/29255.255.255.2486
/30255.255.255.2522
/16255.255.0.065,534
/8255.0.0.016,777,214

Frequently asked questions

What is a subnet mask?

A subnet mask defines which part of an IP address identifies the network and which part identifies the host. For example, 255.255.255.0 (a /24) reserves the first three octets for the network and leaves the last octet for hosts.

What does /24 mean in CIDR notation?

The /24 is the prefix length — it means the first 24 bits of the address are the network portion. A /24 corresponds to the subnet mask 255.255.255.0 and provides 254 usable host addresses.

How many hosts are in a /24, /16, or /8?

A /24 has 254 usable hosts, a /16 has 65,534, and a /8 has 16,777,214. In general, usable hosts = 2^(32 − prefix) − 2, subtracting the network and broadcast addresses.

How are the network and broadcast addresses calculated?

The network address is the IP bitwise-ANDed with the subnet mask (the lowest address in the range). The broadcast address is the highest address, where all host bits are set to 1. Usable hosts are every address in between.

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) notation writes an IP address followed by a slash and a prefix length, such as 10.0.0.0/8. It replaced the older Class A/B/C system and allows flexible network sizing.

Related calculators