IP Subnet Calculator

Calculate IPv4 subnets: network/broadcast addresses, host ranges, wildcard masks, and CIDR notation. Plan subnetting for any network size.

e.g., 192.168.1.100
/0 to /32
Binary (network bits | host bits)
IP:ย ย  11000000.10101000.00000001.01100100
Mask: 11111111.11111111.11111111.00000000
โ–  network bits (24)ย ย โ–  host bits (8)
Network Address
192.168.1.0
/24 (Private)
Broadcast Address
192.168.1.255
All host bits = 1
Subnet Mask
255.255.255.0
/24
Wildcard Mask
0.0.0.255
Inverse of subnet mask
Host Range
192.168.1.1 โ€” 192.168.1.254
254 usable hosts
Total Addresses
256
2^8 = 256

Subnet Reference Table

CIDRSubnet MaskHost BitsUsable HostsSize Bar
/16255.255.0.01665,534
/17255.255.128.01532,766
/18255.255.192.01416,382
/19255.255.224.0138,190
/20255.255.240.0124,094
/21255.255.248.0112,046
/22255.255.252.0101,022
/23255.255.254.09510
/24255.255.255.08254
/25255.255.255.1287126
/26255.255.255.192662
/27255.255.255.224530
/28255.255.255.240414
/29255.255.255.24836
/30255.255.255.25222
/31255.255.255.25410
/32255.255.255.25500
Planning notes, formulas, and examples

About the IP Subnet Calculator

Subnetting is a fundamental skill for network engineers, system administrators, and anyone working with IP networks. Our IP Subnet Calculator takes any IPv4 address and subnet mask (in CIDR or dotted-decimal notation) and calculates the network address, broadcast address, usable host range, number of hosts, and wildcard mask.

Enter an IP address like 192.168.1.100 with a prefix length of /24, and see that it belongs to the 192.168.1.0/24 network with 254 usable host addresses from 192.168.1.1 to 192.168.1.254. The calculator handles all subnet sizes from /0 (entire internet) to /32 (single host) and shows the binary representation for visual learning.

Beyond basic subnet calculation, the tool includes a subnet table showing all standard subnet sizes and their properties, a network splitter that divides a network into equal subnets, and a visual display of the network/host bit boundary. Whether you're studying for the CCNA exam, planning a network deployment, or troubleshooting connectivity issues, it gives accurate subnet math.

When This Page Helps

Eliminate manual subnet math errors. Plan network deployments, troubleshoot connectivity, and study for networking certifications with instant, visual subnet calculations. Use it to size subnets, reserve address ranges, and verify masks, gateways, and host counts before you touch router or DHCP configs.

How to Use the Inputs

  1. Enter an IPv4 address (e.g., 192.168.1.100).
  2. Enter the subnet mask in CIDR notation (/24) or dotted decimal (255.255.255.0).
  3. View network address, broadcast address, host range, and host count.
  4. Check the binary visualization to understand the network/host bit boundary.
  5. Use the subnet table to compare different prefix lengths.
  6. Use the subnet splitter to divide a network into smaller subnets.
Formula used
Network Address = IP AND Subnet Mask Broadcast Address = IP OR (NOT Subnet Mask) First Host = Network Address + 1 Last Host = Broadcast Address - 1 Total Hosts = 2^(32 - prefix) - 2 Wildcard Mask = NOT Subnet Mask

Example Calculation

Result: Network: 192.168.1.0/24 | Hosts: 254

With /24, the first 24 bits are the network portion. Network address is 192.168.1.0, broadcast is 192.168.1.255, usable hosts range from .1 to .254 (254 addresses). Subnet mask is 255.255.255.0, wildcard is 0.0.0.255.

Tips & Best Practices

  • Remember the powers of 2: /24=254 hosts, /25=126, /26=62, /27=30, /28=14, /29=6, /30=2.
  • Use /30 or /31 for point-to-point links between routers.
  • Always leave room for growth โ€” if you need 50 hosts, use /26 (62) instead of /26 exactly.
  • Private networks (RFC 1918) should use 10.0.0.0/8 for maximum flexibility.
  • VLSM (Variable Length Subnet Masking) lets you use different subnet sizes within the same network.
  • The network address always has all host bits set to 0 and broadcast has all set to 1.

IPv4 Subnetting Fundamentals

IPv4 addresses are 32-bit numbers, typically written as four octets in dotted-decimal notation (e.g., 192.168.1.100). The subnet mask determines which bits identify the network and which identify individual hosts. In CIDR notation, /24 means the first 24 bits are the network portion, leaving 8 bits (256 values) for hosts โ€” minus 2 reserved addresses (network and broadcast), yielding 254 usable hosts.

Subnetting allows large networks to be divided into smaller, more manageable segments. This improves security (by isolating departments), reduces broadcast traffic (broadcasts stay within their subnet), and simplifies routing. Modern networks almost universally use VLSM (Variable Length Subnet Masking), where different subnets within the same organization can have different prefix lengths based on their actual host requirements.

Common Subnet Sizes and Use Cases

The most commonly used subnet sizes are: /24 (254 hosts) for small to medium LANs, /25-/26 for smaller departments, /27-/28 for server VLANs, /30 for point-to-point router links (2 host addresses), and /32 for loopback addresses. For large campuses, /22 (1022 hosts) or /21 (2046 hosts) are used for wireless networks where many devices connect simultaneously.

Cloud environments introduce additional subnetting considerations. AWS VPC subnets reserve 5 IP addresses per subnet (not just 2), reducing usable hosts. Azure and GCP have similar reservations. When planning cloud network architecture, oversized subnets waste IP space in small VPCs, but undersized subnets can't accommodate auto-scaling โ€” the sweet spot depends on expected peak utilization.

Supernetting and Route Aggregation

The inverse of subnetting is supernetting (route aggregation or summarization). If you have four /24 networks โ€” 192.168.0.0/24 through 192.168.3.0/24 โ€” they can be advertised as a single /22 route (192.168.0.0/22). This reduces routing table size and improves routing efficiency. CIDR was specifically designed to enable this aggregation, replacing the wasteful Class A/B/C system that led to rapid IPv4 exhaustion. Modern ISPs and backbone routers rely heavily on route aggregation to keep the global routing table manageable (currently around 950,000 routes).

Sources & Methodology

Last updated:

Frequently Asked Questions

  • A subnet mask divides an IP address into network and host portions. The mask has 1-bits for the network part and 0-bits for the host part. /24 means 24 network bits and 8 host bits, allowing 254 hosts per subnet.