Subnet Calculator

Enter an IP address with a CIDR prefix (e.g. 192.168.1.0/24) or a subnet mask (e.g. 10.0.0.0 255.255.0.0) to calculate all network details instantly.

Understanding Subnets and CIDR Notation

Subnetting divides a large IP network into smaller, manageable segments called subnets. Each subnet has its own address range, which improves security, reduces broadcast traffic, and allows for more efficient IP address allocation. CIDR (Classless Inter-Domain Routing) notation expresses this using a prefix length - The number after the slash indicates how many bits belong to the network portion.

How Subnet Masks Work

A subnet mask is a 32-bit number that divides an IP address into the network part (bits set to 1) and the host part (bits set to 0). For example, a /24 mask (255.255.255.0) means the first 24 bits identify the network, leaving 8 bits for host addresses - Giving 256 total addresses and 254 usable hosts.

Common Subnet Reference

CIDRSubnet MaskTotal AddressesUsable HostsUse Case
/8255.0.0.016,777,21616,777,214Large ISP / cloud provider blocks
/12255.240.0.01,048,5761,048,574RFC 1918 private range (172.16.0.0/12)
/16255.255.0.065,53665,534Large campus / enterprise
/20255.255.240.04,0964,094Large office building or data center
/22255.255.252.01,0241,022Medium enterprise network
/24255.255.255.0256254Standard LAN subnet
/25255.255.255.128128126Half of a /24 - Departmental segment
/26255.255.255.1926462Small office floor or VLAN
/28255.255.255.2401614Small VLAN / server cluster
/29255.255.255.24886Very small segment
/30255.255.255.25242Point-to-point WAN links
/31255.255.255.25422P2P links (RFC 3021 - No broadcast)
/32255.255.255.25511Single host route / loopback

Common Subnet Sizes in Enterprise Networks

Relative frequency of subnet prefix use in enterprise environments

/24 (254 hosts)
Most common
/16 (65K hosts)
Campus/HQ
/22 (1K hosts)
Medium office
/28 (14 hosts)
Server VLANs
/30 (2 hosts)
WAN links
/32 (1 host)
Host routes

Frequently Asked Questions

What is the difference between a subnet mask and a CIDR prefix?

They represent the same information in different formats. A subnet mask like 255.255.255.0 and a CIDR prefix like /24 both mean the first 24 bits of an IP address identify the network. CIDR is more compact and is the modern standard.

Why are 2 addresses always reserved in a subnet?

Every subnet reserves its first address as the network address (e.g. 192.168.1.0) and its last address as the broadcast address (e.g. 192.168.1.255). The broadcast address is used to send packets to all hosts simultaneously. This is why a /24 has 254 usable hosts, not 256.

What is a wildcard mask?

A wildcard mask is the bitwise complement of a subnet mask. Where the subnet mask has a 1-bit (network portion), the wildcard mask has a 0-bit, and vice versa. Wildcard masks are used in Cisco ACLs and OSPF configurations to match ranges of IP addresses.

Related Tools