Subnet Calculator

Calculate network address, broadcast address, host range, and more from an IP and subnet mask.

Reviewed March 2026 How we build our calculators →
Network Address
Broadcast Address
Subnet Mask
Wildcard Mask
First Host
Last Host
Total Hosts
Usable Hosts
CIDR
IP Class
Share

The Formula

Formula
Subnet Mask to CIDR:
/24 = 255.255.255.0 → 256 hosts (254 usable)
/25 = 255.255.255.128 → 128 hosts

Usable Hosts = 2ⁿ − 2
n = host bits (32 − prefix length)
Worked Example
Network: 192.168.1.0/24
Host bits = 32 − 24 = 8
Total addresses = 2⁸ = 256
Usable hosts = 254 (network + broadcast reserved)

What Is Subnetting?

Subnetting divides a larger IP network into smaller, more manageable subnetworks (subnets). Each subnet functions as its own smaller network within the larger one. Subnetting improves network organization, performance (by reducing broadcast traffic), and security (by isolating segments). Every subnet has a network address (the first address, identifying the subnet itself), a broadcast address (the last address, used to reach all hosts on the subnet), and a range of usable host addresses in between.

CIDR Notation

CIDR (Classless Inter-Domain Routing) notation expresses the subnet mask as a suffix indicating how many bits are in the network portion. A /24 means the first 24 bits are the network address, leaving 8 bits for hosts — giving 2⁸ = 256 total addresses (254 usable, since network and broadcast are reserved). A /16 leaves 16 bits for hosts: 2¹⁶ = 65,536 total addresses (65,534 usable). The smaller the CIDR number, the larger the subnet and the more hosts it can accommodate.

Common Subnet Masks

The most common subnet masks in practice: /24 (255.255.255.0) — 254 hosts, used for typical office or home networks. /16 (255.255.0.0) — 65,534 hosts, used for large campus networks. /8 (255.0.0.0) — 16,777,214 hosts, used by large organizations. /30 (255.255.255.252) — only 2 usable hosts, commonly used for point-to-point WAN links between routers. /32 — a host route, referring to a single specific IP address.

Frequently Asked Questions

What is the difference between /24 and /16?

A /24 subnet has 256 total addresses (254 usable for hosts). A /16 has 65,536 total addresses (65,534 usable). The prefix length tells you how many bits are fixed for the network — the remaining bits are available for hosts. Smaller prefix number = larger subnet = more possible hosts.

What is a private IP address?

RFC 1918 defines three ranges of IP addresses reserved for private (non-internet-routable) use: 10.0.0.0/8 (10.x.x.x), 172.16.0.0/12 (172.16.x.x through 172.31.x.x), and 192.168.0.0/16 (192.168.x.x). Your home router assigns private addresses from one of these ranges to your devices and uses NAT (Network Address Translation) to let them share a single public IP for internet access.

How do I calculate the number of usable hosts?

Usable hosts = 2^(32 - prefix length) - 2. The subtraction of 2 accounts for the network address and broadcast address, which cannot be assigned to hosts. For /24: 2^(32-24) - 2 = 2^8 - 2 = 256 - 2 = 254 usable hosts. For /28: 2^4 - 2 = 16 - 2 = 14 usable hosts.

What is a subnet mask?

A subnet mask is a 32-bit number that identifies which portion of an IP address is the network address and which is the host address. It consists of a continuous block of 1s (network portion) followed by 0s (host portion). The mask 255.255.255.0 in binary is 24 ones followed by 8 zeros — equivalent to /24 in CIDR notation. Bitwise AND of an IP address with its subnet mask gives the network address.

What is the broadcast address used for?

The broadcast address is the last address in a subnet (all host bits set to 1). Packets sent to the broadcast address are delivered to all devices on that subnet. It is used for ARP (Address Resolution Protocol) requests, DHCP discovery, and other protocols that need to reach all hosts on a network segment without knowing individual IP addresses. The broadcast address cannot be assigned to a specific host.

Share
Results are calculated using standard scientific formulas and are intended for educational purposes. Verify critical calculations independently.
Scroll to Top