Skip to content

IP Subnet Calculator — Free Online IPv4 Subnet Tool

Calculate subnet details for any IPv4 address and CIDR prefix length. Instantly find the network address, broadcast address, subnet mask, wildcard mask, first and last usable hosts, total host count, IP class, and private address status. Essential for network engineers, system administrators, and IT students.

/24

Tip: Common CIDR values: /8 (Class A), /16 (Class B), /24 (Class C), /32 (single host).

Subnet Details

Network Address192.168.1.0
Broadcast Address192.168.1.255
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
First Host192.168.1.1
Last Host192.168.1.254
Total Hosts256
Usable Hosts254
IP ClassC
Private AddressYes

How to Use the IP Subnet Calculator

  1. Enter an IP address: Type any valid IPv4 address in dotted decimal notation into the IP Address field. For example, 192.168.1.0, 10.0.0.1, or 172.16.50.100. The address does not need to be the network address; the calculator will determine the correct network address based on the CIDR prefix you provide. Each octet should be a number from 0 to 255, separated by periods.
  2. Set the CIDR prefix length: Enter the CIDR prefix length as a number from 0 to 32. This value determines the size of the subnet. A /24 gives you 254 usable hosts, a /25 gives 126, a /26 gives 62, and so on. Each time you increase the CIDR by 1, the number of available hosts is halved. Common values for home networks are /24, for enterprise departments /22 to /26, and for point-to-point links /30 or /31.
  3. Review subnet details: The results panel instantly displays all critical subnet information. The network address is the starting boundary of the subnet. The broadcast address is the ending boundary. The subnet mask shows which bits belong to the network versus host portions. The wildcard mask is the inverse of the subnet mask, used in Cisco ACLs and OSPF. First and last host addresses define the assignable range for devices.
  4. Use the results for network planning: Apply the calculated subnet information to configure your routers, switches, firewalls, and DHCP scopes. The network address goes into routing tables. The usable host range defines your DHCP pool. The broadcast address should be excluded from static assignments. The wildcard mask is needed for Cisco ACL entries and OSPF area definitions.

All results update instantly as you change the IP address or CIDR prefix. Experiment with different prefix lengths to find the optimal subnet size for your network requirements.

Subnet Calculation Formula

Subnet Mask = (2^32 - 1) shifted left by (32 - CIDR) bits
Network Address = IP Address AND Subnet Mask
Broadcast Address = Network Address OR (NOT Subnet Mask)
Usable Hosts = 2^(32 - CIDR) - 2

Variables Explained

  • IP Address: A 32-bit number uniquely identifying a device on a network, written as four octets in dotted decimal notation (e.g., 192.168.1.100). Each octet represents 8 bits and ranges from 0 to 255. The IP address contains both the network identifier and the host identifier.
  • CIDR Prefix: A number from 0 to 32 indicating how many of the 32 bits are used for the network portion. A /24 means the first 24 bits are the network and the last 8 bits are for hosts. This replaced the older classful system where only /8, /16, and /24 were standard network boundaries.
  • Subnet Mask: A 32-bit value where the network bits are all 1s and the host bits are all 0s. For /24, the mask is 11111111.11111111.11111111.00000000 or 255.255.255.0 in decimal. The AND operation between the IP and mask isolates the network portion.
  • Wildcard Mask: The bitwise complement of the subnet mask. For a /24 subnet with mask 255.255.255.0, the wildcard mask is 0.0.0.255. Used in Cisco IOS configurations for ACLs and routing protocols where a 0 bit means "must match" and a 1 bit means "don't care."

Step-by-Step Example

Calculate the subnet details for the IP address 10.50.100.200 with a /20 prefix:

  1. Convert the /20 prefix to a subnet mask: first 20 bits are 1s = 255.255.240.0
  2. AND the IP with the mask: 10.50.100.200 AND 255.255.240.0 = 10.50.96.0 (network address)
  3. Calculate wildcard mask: 255 - 255 = 0, 255 - 255 = 0, 255 - 240 = 15, 255 - 0 = 255 = 0.0.15.255
  4. OR the network with the wildcard: 10.50.96.0 OR 0.0.15.255 = 10.50.111.255 (broadcast address)
  5. First host: network + 1 = 10.50.96.1
  6. Last host: broadcast - 1 = 10.50.111.254
  7. Total hosts: 2^(32-20) = 2^12 = 4,096
  8. Usable hosts: 4,096 - 2 = 4,094

This /20 subnet provides 4,094 usable host addresses ranging from 10.50.96.1 to 10.50.111.254. It covers 16 Class C equivalent blocks, making it suitable for a medium-sized campus or data center segment. The address 10.x.x.x falls in the Class A private range, confirming it is a non-routable internal address.

Practical Examples

Example 1: Nathan's Home Network Setup

Nathan is setting up a home network with 12 devices including laptops, phones, a smart TV, a gaming console, and IoT devices. He wants to configure his router's DHCP scope properly:

  • IP address: 192.168.1.0
  • CIDR prefix: /24
  • Network address: 192.168.1.0
  • Broadcast address: 192.168.1.255
  • Usable hosts: 254 (192.168.1.1 to 192.168.1.254)

Nathan assigns 192.168.1.1 to his router (default gateway), reserves 192.168.1.2 through 192.168.1.10 for static devices like his NAS and printer, and sets the DHCP pool from 192.168.1.50 to 192.168.1.200. This gives him plenty of room for current devices and future additions while keeping static and dynamic address ranges separated.

Example 2: Lisa's Office Network Segmentation

Lisa is a network administrator designing a segmented network for a 200-person company with four departments. She uses the subnet calculator to plan her VLSM scheme starting with 10.10.0.0/16:

  • Engineering (80 devices): 10.10.0.0/25 — 126 usable hosts (10.10.0.1 to 10.10.0.126)
  • Sales (60 devices): 10.10.0.128/26 — 62 usable hosts (10.10.0.129 to 10.10.0.190)
  • Marketing (40 devices): 10.10.1.0/26 — 62 usable hosts (10.10.1.1 to 10.10.1.62)
  • Executive (15 devices): 10.10.1.64/27 — 30 usable hosts (10.10.1.65 to 10.10.1.94)

By using different subnet sizes for each department, Lisa avoids wasting IP addresses and creates natural firewall boundaries between departments. She configures inter-VLAN routing on the core switch and applies access control lists to restrict executive subnet access to authorized personnel only.

Example 3: Derek's Data Center Planning

Derek is designing the IP addressing scheme for a new data center that will host 500 virtual machines across three availability zones. He uses a /21 block:

  • Parent block: 172.16.0.0/21
  • Total addresses: 2,048
  • Usable hosts: 2,046
  • Zone A: 172.16.0.0/23 — 510 usable hosts
  • Zone B: 172.16.2.0/23 — 510 usable hosts
  • Zone C: 172.16.4.0/23 — 510 usable hosts

Each zone gets a /23 subnet with 510 usable addresses, providing ample room for the planned 167 VMs per zone plus future growth. Derek reserves the remaining 172.16.6.0/23 block for management networks, monitoring systems, and out-of-band access. The 172.16.x.x range is a Class B private address space, ideal for internal data center use.

CIDR Subnet Reference Table

CIDR Subnet Mask Total Hosts Usable Hosts
/32 255.255.255.255 1 1
/30 255.255.255.252 4 2
/28 255.255.255.240 16 14
/24 255.255.255.0 256 254
/20 255.255.240.0 4,096 4,094
/16 255.255.0.0 65,536 65,534
/8 255.0.0.0 16,777,216 16,777,214

Each CIDR decrease by 1 doubles the number of available hosts. A /31 has 2 hosts (point-to-point), a /32 has 1 (single host).

Tips and Complete Guide

Planning Your Network Architecture

Effective subnet planning starts with understanding your current needs and anticipating growth. Begin by inventorying all network-connected devices including workstations, servers, printers, IP phones, wireless access points, security cameras, and IoT sensors. Group devices by function, location, or security requirements. Assign each group to a separate VLAN and subnet. Use Variable Length Subnet Masking (VLSM) to allocate appropriately sized subnets rather than giving every group a /24. Document your IP addressing scheme thoroughly, including reserved ranges for network infrastructure (gateways, DNS, DHCP servers) and future expansion blocks. A well-planned addressing scheme reduces administrative overhead, improves troubleshooting speed, and prevents address conflicts as the network grows.

Subnet Design Best Practices

Follow these proven practices for robust subnet design. Use private address space (RFC 1918) for internal networks and NAT for internet access. Keep subnets small enough to limit broadcast domains but large enough to accommodate growth. A maximum of 250 to 500 devices per subnet is recommended to maintain acceptable broadcast traffic levels. Assign consistent gateway addresses (such as always using .1 or .254) across all subnets for ease of management. Reserve address ranges within each subnet for infrastructure (.1 to .10), static assignments (.11 to .49), and DHCP pools (.50 to .200). Use /30 or /31 subnets for point-to-point router links to conserve addresses. Our bandwidth calculator can help you assess throughput requirements between subnets.

Subnetting for Cloud and Virtualization

Cloud platforms like AWS, Azure, and Google Cloud require careful subnet planning within Virtual Private Clouds (VPCs). Each availability zone typically needs its own subnet, and you must account for the cloud provider's reserved addresses (AWS reserves 5 per subnet). Plan larger subnets than you think you need because expanding a cloud subnet after deployment can be disruptive. Use a /20 or /21 per availability zone for production workloads, a /24 for management networks, and /28 for load balancers or NAT gateways. In containerized environments using Kubernetes, each pod gets its own IP address, so plan for potentially thousands of addresses per cluster using /16 or larger pod network CIDRs.

Common Mistakes to Avoid

  • Using the same subnet for everything: Putting all devices on a single large subnet creates excessive broadcast traffic, eliminates security boundaries, and makes troubleshooting difficult. Segment your network into functional or departmental subnets even if you have enough addresses in one block.
  • Not planning for growth: A subnet that perfectly fits your current device count will run out of addresses as soon as a new device is added. Always allocate at least 30% to 50% more addresses than your current requirement. Resubnetting an established network is disruptive and error-prone.
  • Confusing subnet mask and wildcard mask: The subnet mask (255.255.255.0) and wildcard mask (0.0.0.255) are inverses of each other but used in different contexts. Using a subnet mask where a wildcard mask is required (such as in a Cisco ACL) will produce unexpected filtering behavior that is difficult to debug.
  • Overlapping subnet ranges: When creating multiple subnets from a larger block, ensure they do not overlap. For example, if you assign 192.168.1.0/25 and 192.168.1.0/26, the /26 is entirely contained within the /25, causing routing conflicts. Always verify that the next subnet starts after the broadcast address of the previous one.
  • Forgetting reserved addresses: Every standard subnet loses at least 2 addresses (network and broadcast). Cloud providers may reserve additional addresses. A /30 has only 2 usable addresses, a /31 has 2 (point-to-point only), and a /32 is a single host address used for loopbacks. Always account for these when calculating capacity.

Frequently Asked Questions

Subnetting is the practice of dividing a larger IP network into smaller, more manageable subnetworks called subnets. It is important for several reasons. First, it improves network performance by reducing broadcast traffic because broadcasts are confined to individual subnets rather than flooding the entire network. Second, it enhances security by isolating different departments, devices, or functions into separate subnets, making it harder for unauthorized traffic to cross boundaries. Third, it optimizes IP address usage by allocating addresses in appropriately sized blocks rather than wasting large blocks on small networks. For example, giving a 10-device office a /24 subnet (254 usable addresses) wastes 244 addresses, while a /28 subnet (14 usable addresses) is more efficient.

CIDR (Classless Inter-Domain Routing) notation is a compact way to specify an IP address and its associated subnet mask. It uses a forward slash followed by a number from 0 to 32 that indicates how many bits of the 32-bit IP address are used for the network portion. For example, 192.168.1.0/24 means the first 24 bits identify the network and the remaining 8 bits are available for host addresses. A /24 provides 256 total addresses and 254 usable host addresses. A /16 provides 65,536 total addresses. The higher the CIDR number, the smaller the subnet. CIDR replaced the older classful addressing system (Class A, B, C) in 1993 to allow more flexible and efficient IP address allocation.

The network address and broadcast address are two special addresses in every subnet that cannot be assigned to individual hosts. The network address is the first address in the subnet range, where all host bits are set to 0. It identifies the subnet itself and is used in routing tables to direct traffic. For example, in the subnet 192.168.1.0/24, the network address is 192.168.1.0. The broadcast address is the last address in the range, where all host bits are set to 1. It is used to send a message to all devices on the subnet simultaneously. In our example, the broadcast address is 192.168.1.255. This is why a /24 subnet has 256 total addresses but only 254 usable host addresses.

Private IP address ranges are blocks of addresses reserved for use within internal networks that are not routable on the public internet. RFC 1918 defines three private address ranges: 10.0.0.0 to 10.255.255.255 (10.0.0.0/8), which provides over 16 million addresses and is commonly used in large enterprises; 172.16.0.0 to 172.31.255.255 (172.16.0.0/12), which provides about 1 million addresses and is often used in medium-sized organizations; and 192.168.0.0 to 192.168.255.255 (192.168.0.0/16), which provides 65,536 addresses and is the most common range for home networks and small businesses. These addresses can be reused across millions of private networks without conflicts because routers do not forward private address traffic to the internet.

To determine the right subnet size, start by counting the number of devices that need IP addresses, including computers, printers, phones, servers, and IoT devices. Add 20% to 50% growth capacity for future expansion. Then find the smallest CIDR prefix that accommodates this number. For 10 devices, use a /28 (14 usable addresses). For 25 devices, use a /27 (30 usable). For 50 devices, use a /26 (62 usable). For 100 devices, use a /25 (126 usable). For 200 devices, use a /24 (254 usable). Remember that every subnet loses 2 addresses to the network and broadcast addresses, and you may need additional addresses for the default gateway, DHCP server, and other infrastructure devices.

A wildcard mask is the inverse of a subnet mask, created by subtracting each octet of the subnet mask from 255. For example, the wildcard mask for 255.255.255.0 (/24) is 0.0.0.255. Wildcard masks are primarily used in Cisco router and switch access control lists (ACLs) and OSPF routing protocol configurations. In an ACL, the wildcard mask specifies which bits of an IP address should be checked and which should be ignored. A 0 bit means the corresponding address bit must match exactly, and a 1 bit means the corresponding address bit can be anything. This makes wildcard masks useful for matching ranges of addresses. For example, a wildcard mask of 0.0.0.15 applied to 192.168.1.0 matches all addresses from 192.168.1.0 through 192.168.1.15.

IPv4 addresses were originally divided into five classes. Class A ranges from 1.0.0.0 to 126.255.255.255 with a default mask of /8, providing over 16 million host addresses per network. Class B ranges from 128.0.0.0 to 191.255.255.255 with a /16 default mask, providing 65,534 hosts. Class C ranges from 192.0.0.0 to 223.255.255.255 with a /24 default mask, providing 254 hosts. Class D (224 to 239) is reserved for multicast, and Class E (240 to 255) is reserved for experimental use. While classful addressing was officially replaced by CIDR in 1993, understanding IP classes still matters because many network devices use class-based defaults, network certification exams test this knowledge, and the class system helps explain why certain address ranges are structured the way they are.

Yes, you can subnet a subnet, and this technique is called Variable Length Subnet Masking (VLSM). VLSM allows you to divide a network into subnets of different sizes rather than forcing all subnets to be the same size. For example, if you have a /24 network (192.168.1.0/24), you can create one /25 subnet with 126 hosts for your main office, one /26 with 62 hosts for a branch, and two /28 subnets with 14 hosts each for point-to-point links. VLSM is essential for efficient IP address management in modern networks. To implement VLSM, start with the largest subnet first, allocate it from the beginning of the address range, then allocate progressively smaller subnets from the remaining space. All modern routing protocols including OSPF, EIGRP, and BGP support VLSM.

Related Calculators

Disclaimer: This calculator is for informational and educational purposes only. Results are estimates and may not reflect exact values.

Last updated: February 23, 2026

Sources