All calculators

Converters

Subnet Calculator

Last updated: June 17, 2026

Blake Boege
Written by Blake Boege · Founder, Calculator Answers

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 Details

Subnet Mask

255.255.255.0

Network: 192.168.1.0 / 24

Network Address192.168.1.0
Usable Host IP Range192.168.1.1 – 192.168.1.254
Broadcast Address192.168.1.255
Wildcard Mask0.0.0.255
Total Hosts256
Usable Hosts254

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).

Was this helpful?

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:

1. Subnet Mask:

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

2. Network ID:

Calculated by performing a bitwise AND operation between the IP address and the subnet mask:

Network ID = IP AND Subnet Mask

3. Wildcard Mask:

Calculated by taking the bitwise NOT of the subnet mask:

Wildcard Mask = NOT Subnet Mask

4. Broadcast Address:

Calculated by performing a bitwise OR operation between the Network ID and the Wildcard Mask:

Broadcast = Network ID OR Wildcard Mask

5. Host Sizing:

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

ClassIP RangeDefault PrefixPurpose
Class A1.0.0.0 – 126.0.0.0/8Very large networks
Class B128.0.0.0 – 191.255.0.0/16Medium to large networks
Class C192.0.0.0 – 223.255.255.0/24Small local networks
Class D224.0.0.0 – 239.255.255.255N/AMulticasting (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 Converters

Frequently asked questions

Subnetting is the practice of dividing a single large network into smaller, logical sub-networks (subnets). This improves network routing efficiency, security, and IP address management.

CIDR (Classless Inter-Domain Routing) prefix (like /24) represents the number of consecutive binary 1s in the subnet mask. For example, a /24 prefix has 24 bits set to 1, which corresponds to a decimal subnet mask of 255.255.255.0.

In standard subnets, two IP addresses are reserved for network administrative purposes: the first address (network ID) represents the subnet itself, and the last address (broadcast address) is used to send packets to all hosts on the subnet.

A wildcard mask is the bitwise inverse of the subnet mask. It is calculated by subtracting each octet of the subnet mask from 255. In Cisco router configurations, wildcard masks are used in access control lists (ACLs) to define IP matching rules.

Private IPs are reserved for internal networks and are not routable on the public internet. The standard ranges defined by RFC 1918 are: 10.0.0.0 – 10.255.255.255, 172.16.0.0 – 172.31.255.255, and 192.168.0.0 – 192.168.255.255.