Subnet Calculator
Calculate IP subnets, CIDR ranges, network addresses, broadcast addresses, and host counts.
How to Use the Subnet Calculator
- Select a calculator mode: CIDR Calculator, Subnet Mask, or IP Range.
- For CIDR mode, enter an IP address and select the CIDR prefix (e.g., /24, /16).
- For Subnet Mask mode, enter an IP address and subnet mask (e.g., 255.255.255.0).
- For IP Range mode, enter start and end IP addresses to count total IPs.
- Click Calculate to see network address, broadcast, usable hosts, and more.
Formula & Method
Network Address:Network = IP Address AND Subnet Mask
Broadcast Address:Broadcast = Network OR (NOT Subnet Mask)
Usable Hosts:Hosts = 2^(32 - CIDR) - 2 (subtract 2 for network and broadcast)
CIDR to Subnet Mask:Mask = 0xFFFFFFFF << (32 - CIDR)
IP to Long Integer:Long = (A << 24) + (B << 16) + (C << 8) + D
Where IP = A.B.C.D and each octet is 0-255.
Examples
| IP Address | CIDR | Network | Broadcast | Usable Hosts | Mask |
|---|---|---|---|---|---|
| 192.168.1.0 | /24 | 192.168.1.0 | 192.168.1.255 | 254 | 255.255.255.0 |
| 10.0.0.0 | /8 | 10.0.0.0 | 10.255.255.255 | 16,777,214 | 255.0.0.0 |
| 172.16.0.0 | /16 | 172.16.0.0 | 172.16.255.255 | 65,534 | 255.255.0.0 |
| 192.168.1.0 | /30 | 192.168.1.0 | 192.168.1.3 | 2 | 255.255.255.252 |
| 192.168.1.0 | /28 | 192.168.1.0 | 192.168.1.15 | 14 | 255.255.255.240 |
Frequently Asked Questions
What is a subnet?
A subnet (subnetwork) is a logical subdivision of an IP network. Subnetting allows you to divide a large network into smaller, more manageable segments. Each subnet has a network address, a range of usable host addresses, and a broadcast address.
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation represents an IP address and its subnet mask as a single value, such as 192.168.1.0/24. The number after the slash indicates how many bits are used for the network portion. /24 means the first 24 bits are the network, leaving 8 bits for hosts.
How many usable hosts are in a /24 subnet?
A /24 subnet has 256 total addresses (2^8), but 2 are reserved: one for the network address and one for the broadcast address. This leaves 254 usable host addresses.
What is the difference between a network address and a broadcast address?
The network address is the first address in a subnet and identifies the network itself. The broadcast address is the last address and is used to send data to all hosts on the subnet simultaneously. Neither can be assigned to an individual device.
Can I use this for IPv6 subnets?
This calculator handles IPv4 addresses only. IPv6 uses 128-bit addresses and different subnetting principles. For IPv6 subnet calculations, you would need a dedicated IPv6 subnet calculator.
People Also Ask
What is a /24 subnet?
A /24 subnet has a subnet mask of 255.255.255.0. It provides 256 total IP addresses, with 254 usable for hosts. The network address ends in .0 and the broadcast address ends in .255. This is the most common subnet size for small networks.
How many IP addresses in a /16 subnet?
A /16 subnet has 65,536 total IP addresses (2^16), with 65,534 usable for hosts. The subnet mask is 255.255.0.0. This is commonly used for large organizational networks.
What is a /30 subnet used for?
A /30 subnet provides exactly 2 usable IP addresses, making it ideal for point-to-point links between routers. The subnet mask is 255.255.255.252. It is commonly used in WAN connections.
What is the 192.168.x.x IP range?
192.168.0.0/16 is a private IP address range reserved for internal networks (RFC 1918). It includes 192.168.0.0 to 192.168.255.255. These addresses are not routable on the public internet and are used in homes and offices.
What is the difference between a public and private IP address?
Public IP addresses are routable on the internet and unique globally. Private IP addresses (10.x.x.x, 172.16-31.x.x, 192.168.x.x) are used inside local networks and are translated to public IPs using NAT (Network Address Translation) for internet access.