Calculators.Life Calculator
Engineering

IP Subnet Mask Calculator

Input Parameters

Scenarios
IPv4 Address (e.g. 192.168.1.1)
Subnet prefix length or subnet mask

Computed Results

Network Address
192.168.1.0
Broadcast Address192.168.1.255
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
Usable Host IP Range192.168.1.1 - 192.168.1.254
Usable Host Count254
Total Addresses256
IP ClassClass C
CIDR Notation/24

The IP subnet mask calculator determines the network address, broadcast address, and usable host range for a given IPv4 address and CIDR prefix. It helps network administrators and engineers quickly identify subnet masks, wildcard masks, and total available IP addresses for network planning and routing.

Practical Use Cases

Subnetting divides a single large network into smaller, more manageable sub-networks. This calculator is commonly used when configuring routers, switches, and firewalls to ensure devices are placed in the correct network segment. It is also useful for troubleshooting IP conflicts, planning network expansions, and determining the exact range of IP addresses available for DHCP pools.

Formula & Explanation

An IPv4 address consists of 32 bits. The subnet mask, often represented in CIDR (Classless Inter-Domain Routing) notation, dictates how many of those bits are reserved for the network portion versus the host portion. The remaining bits determine the total number of IP addresses available in that subnet.

To calculate the total number of hosts in a subnet, use the following formula:

Total Hosts = 2^(32 − CIDR)

In most standard subnets, the first address is reserved as the network address, and the last address is reserved as the broadcast address. Therefore, the number of usable hosts for assigning to devices is calculated as:

Usable Hosts = Total Hosts − 2

There are specific exceptions to this rule. For example, a /31 subnet is used for point-to-point links and provides exactly 2 usable hosts, while a /32 represents a single host address.

Verified Scenario Walkthroughs

Understanding how different CIDR prefixes affect network size is essential for efficient IP allocation. Here are examples based on standard network configurations:

Standard Class C Network (/24)

A common configuration for local area networks uses an IP address like 192.168.1.10 with a /24 subnet mask. This allocates 24 bits for the network and 8 bits for hosts. The network address is 192.168.1.0, and the broadcast address is 192.168.1.255. This results in 256 total addresses and 254 usable hosts ranging from 192.168.1.1 to 192.168.1.254.

Small Subnet (/28)

For a smaller network segment, such as 192.168.0.1 with a /28 subnet, the subnet mask is 255.255.255.240. This configuration yields 16 total addresses. After reserving the network address (192.168.0.0) and broadcast address (192.168.0.15), there are 14 usable hosts available from 192.168.0.1 to 192.168.0.14.

Point-to-Point Link (/31)

When configuring a direct connection between two routers, a /31 subnet is often used to conserve IP addresses. Using the IP 10.255.255.1 with a /31 prefix results in a subnet mask of 255.255.255.254. This provides exactly 2 total addresses (10.255.255.0 and 10.255.255.1), both of which are usable for the point-to-point link.

Frequently Asked Questions

What is the difference between total hosts and usable hosts?

Total hosts represent every IP address mathematically available within a subnet block. Usable hosts subtract the network address (the first IP) and the broadcast address (the last IP), leaving only the addresses that can be assigned to devices.

What is a wildcard mask?

A wildcard mask is the inverse of a subnet mask. It is commonly used in routing protocols and access control lists (ACLs) to specify which parts of an IP address must match a rule and which parts can be ignored.

How does CIDR notation work?

CIDR (Classless Inter-Domain Routing) notation appends a forward slash and a number to an IP address (e.g., /24). The number represents how many consecutive bits, starting from the left, are set to 1 in the subnet mask.

Author portrait
About the Author
Arnab Biswas

Calculator developer and SEO strategist who builds practical online calculators and tests calculation logic, input handling, and expected results using real-world scenarios.