Subnet Calculator
IP subnet details: network address, broadcast, host range, usable hosts. CIDR notation.
How to Use
Enter your values in the fields above and click Calculate to get instant results. All computations run locally in your browser. No data is ever uploaded or stored.
Related Calculators
Subnet Math Explained
A subnet mask defines which bits of an IP address belong to the network prefix and which belong to the host. CalcSolver computes network address (IP AND mask), broadcast (network OR inverted mask), and usable host range.
Network = IP & subnet mask
Broadcast = network | ~mask
Usable hosts = 2^(32−prefix) − 2
CIDR Block Quick-Reference
/24: 256 addresses · 254 hosts · mask 255.255.255.0
/25: 128 addresses · 126 hosts · mask 255.255.255.128
/26: 64 addresses · 62 hosts · mask 255.255.255.192
/28: 16 addresses · 14 hosts · mask 255.255.255.240
/30: 4 addresses · 2 hosts · mask 255.255.255.252 (point-to-point)
/32: 1 address · 1 host (single-host route)
Understanding IP Subnetting
An IP address is a 32-bit number (IPv4) divided into four octets, written in dotted-decimal notation (e.g., 192.168.1.100). A subnet mask separates the network portion from the host portion of the address. CIDR (Classless Inter-Domain Routing) notation expresses the mask as a prefix length — the number of bits set to 1. CalcSolver's subnet calculator takes an IP and CIDR prefix and instantly computes all derived values: network address, broadcast address, usable host range, and total host count.
How Subnet Masks Work
A subnet mask is a 32-bit number where the network bits are 1 and the host bits are 0. A /24 prefix means 24 network bits: 11111111.11111111.11111111.00000000 in binary, which equals 255.255.255.0 in decimal. The network address is obtained by performing a bitwise AND between the IP and the subnet mask. For 192.168.1.100 with a /24 mask: the network address is 192.168.1.0. The broadcast address (all host bits set to 1) is 192.168.1.255.
The Host Count Formula
The number of usable hosts in a subnet is calculated as: Usable Hosts = 2^(32 − CIDR) − 2. We subtract 2 because the first address in every subnet is the network address (all host bits = 0) and the last is the broadcast address (all host bits = 1) — neither can be assigned to a device. Common examples:
- /24 (255.255.255.0): 2^8 − 2 = 254 usable hosts
- /25 (255.255.255.128): 2^7 − 2 = 126 usable hosts
- /26 (255.255.255.192): 2^6 − 2 = 62 usable hosts
- /28 (255.255.255.240): 2^4 − 2 = 14 usable hosts
- /30 (255.255.255.252): 2^2 − 2 = 2 usable hosts (point-to-point links)
Practical Networking Examples
Small office network: An office with 50 devices needs at least 50 IP addresses. A /26 subnet provides 62 usable hosts — more than enough with room to grow. The network 192.168.1.0/26 spans from 192.168.1.1 to 192.168.1.62, with 192.168.1.63 as the broadcast address.
Data center segmentation: A company divides its 10.0.0.0/8 network into multiple /16 subnets for different departments. Each /16 subnet supports 65,534 hosts, and there are 256 such subnets available. The finance department gets 10.1.0.0/16, engineering gets 10.2.0.0/16, and so on.
Point-to-point WAN links: Router-to-router connections only need 2 IP addresses. A /30 subnet provides exactly 2 usable hosts (plus network and broadcast addresses), wasting no address space. For example, 203.0.113.0/30 gives usable addresses 203.0.113.1 and 203.0.113.2.
Tips for Network Engineers
- Always plan for growth — choose a subnet size that accommodates 20-30% more devices than currently needed.
- Use VLSM (Variable Length Subnet Masking) to assign differently sized subnets to different network segments based on actual host requirements.
- Reserve the first and last usable IPs in each subnet for gateways and network management devices.
- Document your IP address plan in a spreadsheet to avoid overlapping subnets as the network grows.
- Use CalcSolver's base converter to convert between decimal, binary, and hexadecimal IP representations for advanced subnet analysis.
Sponsored Content
The following content is provided by our advertising partner and does not affect the calculator experience.
Frequently Asked Questions
What is subnetting?
Subnetting divides a large IP network into smaller subnetworks. This improves performance by reducing broadcast traffic, enhances security through isolation, and makes efficient use of IP address space.
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation represents the subnet mask as a suffix. /24 means 24 bits for the network (255.255.255.0), /16 means 16 bits (255.255.0.0). Each bit added halves the number of hosts.
Why do we subtract 2 from the host count?
The first address in each subnet is the network address (all host bits 0) and the last is the broadcast address (all host bits 1). Neither can be assigned to a device, so usable hosts = 2^host_bits − 2.
What is the difference between network address and broadcast address?
The network address identifies the subnet itself (all host bits are 0) and is used in routing tables. The broadcast address (all host bits are 1) is used to send data to all devices on the subnet simultaneously. Neither can be assigned to an individual host.
How many subnets can I create from a larger network?
To create subnets, borrow bits from the host portion. Each borrowed bit doubles the number of subnets. For example, borrowing 3 bits from a /24 creates 2^3 = 8 subnets of /27 (30 usable hosts each). The formula is: number of subnets = 2^(new prefix − original prefix).
What subnet mask do I need for a specific number of hosts?
Find the smallest power of 2 that exceeds your host count (plus 2 for network and broadcast). For 100 hosts, you need 2^7 = 128 (126 usable), which is a /25 mask. For 500 hosts, you need 2^9 = 512 (510 usable), a /23 mask.