IP Subnet
CIDR, mask, broadcast, hosts
About This Calculator
Subnet calculators determine the network address, broadcast address, valid host range, and number of usable hosts from an IP address and subnet mask or CIDR notation. Subnetting divides a large network into smaller segments for security isolation, traffic management, and efficient IP address allocation.
Formula
CIDR notation: IP/prefix — e.g. 192.168.1.0/24
Subnet mask from CIDR: /24 = 255.255.255.0 (24 ones, then zeros)
Number of hosts = 2^(32−prefix) − 2 (subtract network and broadcast)
Network address = IP AND subnet mask; Broadcast = network OR (NOT mask)
Example Calculation
Analyze 192.168.10.50/24
- Prefix /24 → mask 255.255.255.0
- Network = 192.168.10.50 AND 255.255.255.0 = 192.168.10.0
- Broadcast = 192.168.10.0 OR 0.0.0.255 = 192.168.10.255
- Hosts: 2^8 − 2 = 254 usable hosts (192.168.10.1 – .254)
Network: 192.168.10.0/24; Hosts: 192.168.10.1-254; Broadcast: 192.168.10.255
Common CIDR Prefixes
| CIDR | Subnet Mask | Hosts | Use Case |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 | Large ISPs (Class A) |
| /16 | 255.255.0.0 | 65,534 | Large organizations (Class B) |
| /24 | 255.255.255.0 | 254 | Small office/home network |
| /25 | 255.255.255.128 | 126 | Split small network in two |
| /28 | 255.255.255.240 | 14 | Small VLAN segment |
| /30 | 255.255.255.252 | 2 | Point-to-point links |
| /32 | 255.255.255.255 | 1 (host) | Single host route |
Frequently Asked Questions
Why do we subtract 2 from the host count?
The first address in a subnet is the network address (identifies the subnet itself) and the last is the broadcast address (sends to all hosts in the subnet). Neither can be assigned to a device. So a /24 subnet with 256 addresses yields 254 usable host addresses.
What is the difference between public and private IP addresses?
Private IP ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are reserved for internal networks and not routed on the internet. Public IPs are globally unique and routable. NAT (Network Address Translation) maps private IPs to a public IP for internet access.
What is VLSM (Variable Length Subnet Masking)?
VLSM allows using different subnet sizes within the same network, allocating exactly as many addresses as needed. A company might use /30 for point-to-point links (2 hosts), /27 for a department (30 hosts), and /24 for a large office (254 hosts) — all from the same IP block.
What is the difference between IPv4 and IPv6 subnetting?
IPv4 uses 32-bit addresses (4 billion total), written as four octets (192.168.1.1). IPv6 uses 128-bit addresses (3.4×10³⁸), written in hexadecimal groups. IPv6 subnets are typically /64, providing 2⁶⁴ host addresses per subnet. CIDR notation is used in both.