Subnet Calculator
A subnet calculator is a networking utility that divides an IP address space into logical network segments (subnets). By combining an IPv4 address with a Classless Inter-Domain Routing (CIDR) prefix (ranging from /0 to /32), the calculator determines the subnet mask, network ID, broadcast address, wildcard mask, and the range of usable host IP addresses. It also computes the total number of hosts and the number of usable hosts (subtracting the network and broadcast addresses). Network engineers, systems administrators, and IT students use this tool to design subnetting schemes and troubleshoot routing configurations.
Calculate IP network parameters including subnet mask, network address, broadcast address, wildcard mask, and usable host ranges.
Quick Answer
Calculate IPv4 subnetting details. Enter an IP address and select a CIDR prefix to find the network, broadcast, wildcard mask, and usable host range.
IP Configuration
Enter a dotted-decimal IPv4 address. · e.g. 192.168.1.1
Select the subnet size bits.
Subnet Mask
255.255.255.0
Network: 192.168.1.0 / 24
Standard IPv4 classless subnetting calculations. Total hosts include network and broadcast IPs. Usable hosts subtract network and broadcast IDs (except for /31 or /32 peer-to-peer configurations).
Examples
Local Network Baseline · 192.168.1.1 / 24
Mask: 255.255.255.0 · Usable: 192.168.1.1 – 192.168.1.254 · Hosts: 254
Small Segment · 10.0.0.1 / 30
Mask: 255.255.255.252 · Usable: 10.0.0.1 – 10.0.0.2 · Hosts: 2
Medium Enterprise · 172.16.0.1 / 20
Mask: 255.255.240.0 · Usable: 172.16.0.1 – 172.16.15.254 · Hosts: 4,094
Large Private Scope · 10.0.0.1 / 8
Mask: 255.0.0.0 · Usable: 10.0.0.1 – 10.255.255.254 · Hosts: 16,777,214
How it works
How Subnet Math Works
Subnet calculations are done at the binary level using bitwise operations:
A 32-bit mask is created with the number of 1s equal to the CIDR prefix, padded by 0s:
/24 = 11111111.11111111.11111111.00000000 = 255.255.255.0
Calculated by performing a bitwise AND operation between the IP address and the subnet mask:
Network ID = IP AND Subnet Mask
Calculated by taking the bitwise NOT of the subnet mask:
Wildcard Mask = NOT Subnet Mask
Calculated by performing a bitwise OR operation between the Network ID and the Wildcard Mask:
Broadcast = Network ID OR Wildcard Mask
Total IP addresses is 2 raised to the power of the host bits (32 − prefix):
Total Hosts = 2^(32 − prefix)
Usable Hosts = Total Hosts − 2
Subnet Classes Reference Table
| Class | IP Range | Default Prefix | Purpose |
|---|---|---|---|
| Class A | 1.0.0.0 – 126.0.0.0 | /8 | Very large networks |
| Class B | 128.0.0.0 – 191.255.0.0 | /16 | Medium to large networks |
| Class C | 192.0.0.0 – 223.255.255.0 | /24 | Small local networks |
| Class D | 224.0.0.0 – 239.255.255.255 | N/A | Multicasting (not subnetted) |
Note: Classless Inter-Domain Routing (CIDR) has largely replaced classful network boundaries. Today, CIDR allows routing tables to aggregate addresses flexibly regardless of the historical class boundaries.
Related Calculators
More tools from Unit Converters



