Subnet Calculator

Part of Network & Web Tools

Calculate subnet masks, IP ranges, CIDR notation, and network details for IPv4 addressing and network planning.

How to Use the Subnet Calculator

  1. Enter IP address: Type any valid IPv4 address (e.g., 192.168.1.1, 10.0.0.1).
  2. Enter subnet mask: Provide either CIDR notation (/24, /16) or dotted decimal (255.255.255.0).
  3. Calculate: Click "Calculate" to see network address, broadcast address, usable IP range, and total hosts.
  4. Plan your network: Use the results to design network segments, allocate IP addresses, and configure routers.

Understanding Subnetting

Subnetting is the practice of dividing a network into smaller sub-networks (subnets). This improves network performance by reducing broadcast domains, enhances security through network segmentation, and allows more efficient use of IP address space. Each subnet has its own network address, broadcast address, and range of usable host addresses. Find your current IP with our IP Address Lookup tool.

When you subnet a network, you're essentially borrowing bits from the host portion of the IP address to create additional network bits. For example, a Class C network (255.255.255.0 or /24) gives you 254 usable addresses. By subnetting to /25, you create two subnets with 126 usable addresses each. This allows you to separate departments, VLANs, or security zones while using a single allocated IP block.

CIDR Notation Explained

CIDR (Classless Inter-Domain Routing) notation uses a slash followed by a number to indicate how many bits are used for the network portion of the address. For example, /24 means the first 24 bits are the network portion, leaving 8 bits for hosts. This equals 255.255.255.0 in decimal notation. The number after the slash can range from 0 to 32 for IPv4.

Common CIDR values and their meanings: /32 = single host (255.255.255.255), /24 = 254 hosts (255.255.255.0), /16 = 65,534 hosts (255.255.0.0), /8 = 16,777,214 hosts (255.0.0.0). The formula for usable hosts is 2^(32-CIDR) - 2, where we subtract 2 for the network address and broadcast address.

Subnet Mask Components

Network Address: The first address in the subnet, identifies the network itself. All host bits are set to 0. Cannot be assigned to a device. Used in routing tables to identify the subnet.

Broadcast Address: The last address in the subnet, used to send packets to all devices on that subnet. All host bits are set to 1. Cannot be assigned to a device.

First Usable Address: Network address + 1. This is the first IP you can assign to a device, often used for the router/gateway.

Last Usable Address: Broadcast address - 1. The final IP you can assign to a device on this subnet.

Total Hosts: Number of IP addresses in the subnet. Calculated as 2^(host bits).

Usable Hosts: Total hosts minus 2 (network and broadcast addresses). This is how many devices you can actually connect.

Common Subnet Masks

/30 (255.255.255.252): 2 usable hosts. Perfect for point-to-point links between routers. Wastes minimal IP space.

/29 (255.255.255.248): 6 usable hosts. Good for small office branches or management networks.

/28 (255.255.255.240): 14 usable hosts. Suitable for small departments or server VLANs.

/27 (255.255.255.224): 30 usable hosts. Medium-sized office segments.

/26 (255.255.255.192): 62 usable hosts. Larger department or floor network.

/25 (255.255.255.128): 126 usable hosts. Splits a Class C network in half.

/24 (255.255.255.0): 254 usable hosts. Traditional Class C network, most common for small-to-medium networks.

/16 (255.255.0.0): 65,534 usable hosts. Class B network, used for large enterprise campus networks.

/8 (255.0.0.0): 16,777,214 usable hosts. Class A network, used by very large organizations or ISPs.

Private IP Address Ranges

Three IP ranges are reserved for private networks and are not routable on the public internet. These addresses can be used freely within your organization without coordination with any authority:

10.0.0.0/8: 10.0.0.0 to 10.255.255.255. Provides 16,777,216 addresses. Often used by large enterprises for their entire corporate network.

172.16.0.0/12: 172.16.0.0 to 172.31.255.255. Provides 1,048,576 addresses. Medium-sized organizations often use this range.

192.168.0.0/16: 192.168.0.0 to 192.168.255.255. Provides 65,536 addresses. Most commonly used by home routers and small businesses. Your home network is probably 192.168.1.0/24 or 192.168.0.0/24.

Subnetting Best Practices

Plan for growth: Always allocate more IP addresses than you currently need. It's difficult to renumber a network later. A good rule is to plan for 2-3x your current requirements.

Use consistent subnetting: Maintain consistent subnet sizes within the same network tier. This simplifies routing and troubleshooting.

Document everything: Maintain detailed documentation of your subnet allocation, including which subnets are assigned to which departments or purposes.

Reserve subnets: Keep some subnets in reserve for future expansion or special purposes.

Consider VLSM: Variable Length Subnet Masking allows different subnet sizes within the same network, maximizing efficiency.

Subnetting for Security

Proper subnetting is crucial for network security. Placing different security zones in separate subnets allows you to control traffic flow with firewalls and access control lists (ACLs). For example, you might have separate subnets for: guest Wi-Fi (no access to internal resources), employee workstations, servers, DMZ (public-facing servers), management/admin (highly restricted), and IoT devices (isolated from critical systems).

Common Subnetting Mistakes

Overlapping subnets: Ensure subnet ranges don't overlap. 192.168.1.0/24 and 192.168.1.128/25 overlap and will cause routing problems.

Forgetting broadcast/network addresses: Remember that not all addresses in a subnet are usable. Always subtract 2 from the total.

Using /31 incorrectly: While /31 (2 addresses, 0 usable in traditional subnetting) seems useless, RFC 3021 allows it for point-to-point links.

Poor subnet sizing: Using a /24 when you only need 10 addresses wastes IPs. Using a /28 when you might need 20 devices requires renumbering later.