IP Subnet Calculator

Enter an IPv4 address and CIDR prefix to instantly calculate the subnet mask, network address, broadcast address, usable host range, and total host count.

Share:
IP Subnet Calculator
/

Common prefixes: /8 (Class A), /16 (Class B), /24 (Class C), /32 (Single Host)

Common subnet masks:

/8255.0.0.016,777,214 hosts
/16255.255.0.065,534 hosts
/24255.255.255.0254 hosts
/28255.255.255.24014 hosts
/30255.255.255.2522 hosts

Enter an IPv4 address and CIDR prefix length to calculate the network address, broadcast address, subnet mask, and usable host range.

What Is IP Subnetting?

IP subnetting is the process of dividing a larger network into smaller, more manageable sub-networks called subnets. Every device on a network needs a unique IP address, and subnetting determines which addresses belong to the same network segment and how many devices that segment can support.

Network engineers, system administrators, and anyone setting up a home or business network use subnetting to organize IP address space, improve security, and control broadcast traffic.

What This Calculator Does

This calculator takes an IPv4 address and a CIDR prefix length and returns the complete subnet information needed to configure and document a network.

  • Inputs: An IPv4 address (e.g. 192.168.1.100) and a CIDR prefix length (e.g. /24)
  • Outputs: Network address, broadcast address, subnet mask, wildcard mask, first and last usable host, total hosts, usable hosts, and IP class

How the Calculation Works

Subnet Mask from CIDR

/24 = 11111111.11111111.11111111.00000000 = 255.255.255.0

The CIDR prefix (e.g. /24) indicates how many leading bits of the 32-bit IP address are the network portion. The remaining bits are the host portion. A /24 has 24 network bits and 8 host bits, supporting 2^8 = 256 total addresses.

Network and Broadcast Address

Network = IP AND Subnet Mask

Broadcast = Network OR Wildcard Mask

The network address is found by performing a bitwise AND between the IP address and the subnet mask. The broadcast address sets all host bits to 1. Usable hosts are all addresses between these two extremes, giving 2^(host bits) - 2 addresses.

How to Use the Calculator

  1. Enter any IPv4 address from your network (e.g. 10.0.0.50)
  2. Enter the CIDR prefix length (e.g. 24 for a typical home or office network)
  3. Click Calculate Subnet to see all network details
  4. Use the network address and subnet mask to configure routers, switches, and firewalls

Example Calculations

Example 1: Home Network

IP: 192.168.1.100/24. Network address: 192.168.1.0. Broadcast: 192.168.1.255. Subnet mask: 255.255.255.0. Usable hosts: 192.168.1.1 to 192.168.1.254, giving 254 devices. This is the most common home and small office network configuration.

Example 2: Point-to-Point Link

IP: 10.0.0.1/30. This subnet supports exactly 2 usable hosts (10.0.0.1 and 10.0.0.2), which is ideal for a point-to-point link between two routers. Using /30 conserves IP address space compared to allocating a full /24 for just two devices.

Real-World Scenarios

Home Network Setup

When configuring a home router, understanding the subnet ensures you assign static IP addresses within the correct range and avoid conflicts. Most home routers use 192.168.1.0/24 or 192.168.0.0/24.

Enterprise Network Planning

IT teams divide a company's IP block into subnets for different departments, floors, or VLANs. A /26 gives 62 usable hosts per subnet, allowing four departments to share a single /24 block without overlapping addresses.

Cloud and VPC Configuration

Cloud providers like AWS, Azure, and Google Cloud require you to define subnets within your Virtual Private Cloud (VPC). This calculator helps you plan your address space and ensure subnets do not overlap before deploying infrastructure.

Why This Calculation Matters

Incorrect subnetting leads to IP address conflicts, devices that cannot communicate, and security vulnerabilities from devices reaching network segments they should not. Getting the subnet right from the start prevents hours of troubleshooting later.

Common Mistakes to Avoid

  • Assigning the network or broadcast address to a host: The first address (network) and last address (broadcast) in a subnet cannot be assigned to devices. Only the addresses between them are usable
  • Overlapping subnets: When creating multiple subnets from a larger block, ensure their ranges do not overlap. For example, 10.0.0.0/25 and 10.0.0.128/25 are the two non-overlapping halves of 10.0.0.0/24
  • Confusing CIDR with subnet mask notation: /24 and 255.255.255.0 represent the same thing. Both notations appear in network equipment configuration and should be understood interchangeably
  • Under-sizing a subnet: Allocating a /28 (14 hosts) when you need 20 devices requires redesigning the network. Plan for future growth by choosing a slightly larger subnet

Frequently Asked Questions

Embed This Calculator

IP Subnet Calculator

Calculate
Reset