Fast • Accurate • No Signup Required

Free IPv4 Subnet Calculator & CIDR Network Tool

⭐ 25+ Tools ⚡ Instant In-Browser Results 🔒 Privacy Focused

IPv4 Subnet Calculator

Calculate subnet masks, network addresses, broadcast addresses, CIDR prefixes, and usable hosts instantly.

Free to Use Instant Results No Signup Required Works in Your Browser
Enter an IPv4 address such as 192.168.1.106.
Select prefix from /0 to /32.
Synchronized with CIDR prefix.
Common Presets:

Calculation Results

192.168.1.106 / 26
Class C (Historical)
Usable Hosts
62
Total IP Addresses
64
Network Address
192.168.1.64
Broadcast Address
192.168.1.127
Network Information
Network Address
192.168.1.64
CIDR Prefix
/26
Subnet Mask
255.255.255.192
Wildcard Mask
0.0.0.63
Broadcast Address
192.168.1.127
Historical IP Class Class C
Host Information
First Usable Host
192.168.1.65
Last Usable Host
192.168.1.126
Total IP Addresses 64
Usable Hosts 62
Host Range 192.168.1.65 – 192.168.1.126
Addressing Mode Classless (CIDR)

How Was This Calculated?

IPv4 Subnetting Guide – Everything You Need to Know

Computer networks rely on IP addressing and subnet masks to route packets accurately between physical computers, virtual machines, cloud instances, and connected appliances. Whether you are an experienced network administrator, a cybersecurity engineer designing isolated security zones, or a student preparing for Cisco CCNA or CompTIA Network+ certifications, mastering subnetting is essential. This comprehensive guide and our IPv4 Subnet Calculator give you instant answers along with the exact mathematical formulas required to understand and calculate network parameters.

What Is a Subnet Calculator?

An IPv4 subnet calculator is an online networking utility designed to take an IP address and a subnet mask (or CIDR prefix) and automatically compute all essential network segmentation values. Rather than requiring manual decimal-to-binary conversions and boolean bitwise math on paper, a subnet calculator provides instant, error-free results directly in your browser.

Specifically, an IPv4 subnet calculator determines:

This tool is actively used by:

What Is a Subnet Mask?

A subnet mask is a 32-bit binary number that determines where the network portion of an IPv4 address ends and where the host portion begins. Every IPv4 device uses the subnet mask to determine whether a target destination address belongs to the local subnet or must be forwarded through a default gateway router to reach an outside network.

Consider this real-world example:

IP Address: 192.168.1.106 Subnet Mask: 255.255.255.0 CIDR Prefix: /24

In dotted-decimal format, an IPv4 address and its mask look like ordinary numbers. In reality, each of the four numbers (octets) represents an 8-bit binary number. When expressed in binary:

How Do You Calculate a Subnet Mask?

To calculate a subnet mask from a CIDR prefix, write out 32 binary bits with N ones followed by (32 - N) zeros, group them into four 8-bit octets, and convert each 8-bit binary octet into decimal. (You can also use our Binary to Decimal Converter to practice octet conversions).

Let's convert CIDR prefix /24:

Prefix: /24 Binary Mask: 11111111.11111111.11111111.00000000 Decimal: 255 .255 .255 .0 Subnet Mask: 255.255.255.0

What about prefixes that split an octet, such as /26? A /26 prefix has 26 ones and 6 zeros:

Binary: 11111111.11111111.11111111.11000000 Octet 4: 128 + 64 + 0 + 0 + 0 + 0 + 0 + 0 = 192 Decimal: 255.255.255.192

Here is how common CIDR prefixes map directly to IPv4 subnet masks:

How Do You Calculate the Network Address?

The network address is the base identifier of an IPv4 subnet. It is mathematically calculated by performing a bitwise logical AND operation between the 32-bit IPv4 address and the 32-bit subnet mask.

Under bitwise AND rules:

Because any octet ANDed with 255 (eight 1s) remains unchanged, you only need to perform binary math on the octet where the subnet boundary falls. Let's walk through an example:

IP Address: 192.168.1.106 Subnet Mask: 255.255.255.192 (/26)

The first three octets (192.168.1) are paired with 255.255.255, so they pass through unchanged. In the fourth octet, we compare 106 with 192 in binary:

Decimal 106: 0 1 1 0 1 0 1 0 Decimal 192: 1 1 0 0 0 0 0 0 (Subnet Mask Octet) ----------------------------- (Bitwise AND) Result: 0 1 0 0 0 0 0 0

Binary 01000000 equals 64 in decimal. Combining all four octets gives:

Network Address: 192.168.1.64 First Usable Host: 192.168.1.65 (Network + 1) Last Usable Host: 192.168.1.126 (Broadcast - 1) Broadcast Address: 192.168.1.127 (Network + 63)

In plain English: any device configured with an IP between 192.168.1.65 and 192.168.1.126 and subnet mask 255.255.255.192 can communicate directly at Layer 2 without passing through a router.

How Do You Calculate the Broadcast Address?

The broadcast address is the highest numeric IP address in an IPv4 subnet block. When a host sends an IP packet to the broadcast address, switches and network interfaces deliver the frame to every device on that local subnet.

To calculate the broadcast address:

  1. Find the network address (e.g., 192.168.1.64).
  2. Set all host bits (trailing zeros of the subnet mask) to binary 1. Alternatively, perform a bitwise OR between the Network Address and the Wildcard Mask (Network | Wildcard).

Using our 192.168.1.106/26 example:

Subnet Mask: 255.255.255.192 Wildcard Mask: 0.0.0.63 Network: 192.168.1.64 Binary OR of 4th Octet: Network (64): 0 1 0 0 0 0 0 0 Wildcard (63): 0 0 1 1 1 1 1 1 ----------------------------- (Bitwise OR) Broadcast: 0 1 1 1 1 1 1 1 => 127 Decimal Broadcast Address: 192.168.1.127

How Do You Calculate Usable Hosts Per Subnet?

To find how many devices can be assigned IP addresses in any standard IPv4 subnet, follow this universal formula:

Host Bits = 32 - CIDR Prefix Total IP Addresses = 2^(Host Bits) Usable Hosts = 2^(Host Bits) - 2

For a standard /24 subnet (subnet mask 255.255.255.0):

Why do we subtract 2? In standard IPv4 networks, two addresses are permanently reserved:

Here are common subnet sizes and their usable host counts:

Important Special Cases (/31 and /32): Do not apply the 2^H - 2 formula to /31 or /32 subnets! Under RFC 3021, /31 subnets have 2 usable hosts without separate network or broadcast reservations. A /32 represents a single host route with 1 IP address.

What Is a /32 Subnet Mask?

A /32 subnet mask corresponds to 255.255.255.255 in dotted-decimal notation. It has exactly 32 network bits and 0 host bits.

Because there are zero host bits, a /32 does not represent a traditional multi-device network. Instead, it identifies a single, unique IPv4 address:

CIDR: /32 Subnet Mask: 255.255.255.255 Binary Mask: 11111111.11111111.11111111.11111111 Host Bits: 0 Total Addresses: 1 Usable Hosts: 1 (The IP itself)

Where is a /32 subnet mask used?

Comparison of small subnets:

CIDR Subnet Mask Host Bits Total Addresses Usable Hosts Primary Use Case
/30 255.255.255.252 2 4 2 Legacy point-to-point router links
/31 255.255.255.254 1 2 2 Modern point-to-point links (RFC 3021)
/32 255.255.255.255 0 1 1 Loopback interfaces, single host routes, firewall rules

IPv4 Subnet Mask Cheat Sheet

Below is a complete reference table for IPv4 subnet masks from /16 through /32. It includes the dotted-decimal subnet mask, wildcard mask, host bits, total block size, and usable host count.

CIDR Subnet Mask Wildcard Mask Host Bits Total Addresses Usable Hosts
/16 255.255.0.0 0.0.255.255 16 65,536 65,534
/17 255.255.128.0 0.0.127.255 15 32,768 32,766
/18 255.255.192.0 0.0.63.255 14 16,384 16,382
/19 255.255.224.0 0.0.31.255 13 8,192 8,190
/20 255.255.240.0 0.0.15.255 12 4,096 4,094
/21 255.255.248.0 0.0.7.255 11 2,048 2,046
/22 255.255.252.0 0.0.3.255 10 1,024 1,022
/23 255.255.254.0 0.0.1.255 9 512 510
/24 255.255.255.0 0.0.0.255 8 256 254
/25 255.255.255.128 0.0.0.127 7 128 126
/26 255.255.255.192 0.0.0.63 6 64 62
/27 255.255.255.224 0.0.0.31 5 32 30
/28 255.255.255.240 0.0.0.15 4 16 14
/29 255.255.255.248 0.0.0.7 3 8 6
/30 255.255.255.252 0.0.0.3 2 4 2
/31 255.255.255.254 0.0.0.1 1 2 2 (RFC 3021)
/32 255.255.255.255 0.0.0.0 0 1 1 (Host Route)

Subnet Calculation Examples

Below are four concrete, practical calculations showing how different prefix lengths behave in real enterprise networks.

Example 1: Standard Office LAN (/24)

Configuration: 192.168.1.106/24 (Subnet Mask: 255.255.255.0)

Network Address: 192.168.1.0 First Usable Host: 192.168.1.1 Last Usable Host: 192.168.1.254 Broadcast Address: 192.168.1.255 Total Addresses: 256 Usable Hosts: 254

Example 2: Medium Department Segment (/26)

Configuration: 192.168.1.106/26 (Subnet Mask: 255.255.255.192)

Network Address: 192.168.1.64 First Usable Host: 192.168.1.65 Last Usable Host: 192.168.1.126 Broadcast Address: 192.168.1.127 Total Addresses: 64 Usable Hosts: 62

Example 3: Traditional Point-to-Point Link (/30)

Configuration: 192.168.1.10/30 (Subnet Mask: 255.255.255.252)

Network Address: 192.168.1.8 First Usable Host: 192.168.1.9 (Router A Interface) Last Usable Host: 192.168.1.10 (Router B Interface) Broadcast Address: 192.168.1.11 Total Addresses: 4 Usable Hosts: 2

Example 4: Loopback or Single Host Route (/32)

Configuration: 192.168.1.10/32 (Subnet Mask: 255.255.255.255)

Network Address: 192.168.1.10 First Usable Host: 192.168.1.10 Last Usable Host: 192.168.1.10 Broadcast Address: N/A (Single Host Route) Total Addresses: 1 Usable Hosts: 1

CIDR Notation Explained

CIDR stands for Classless Inter-Domain Routing. Introduced in 1993 by the Internet Engineering Task Force (IETF) under RFC 1519, CIDR replaced the rigid legacy classful architecture (Class A, B, and C) that was exhausting IPv4 address space at an alarming rate.

Instead of constraining organizations to rigid blocks of 16 million addresses (Class A) or 65,536 addresses (Class B), CIDR allows network administrators to specify any arbitrary prefix length by appending a slash (/) and the count of network bits.

Let's deconstruct 192.168.1.0/24:

Common CIDR blocks in real-world infrastructure:

Common Subnetting Questions

How many usable hosts are in a /24 subnet?

A /24 subnet contains exactly 254 usable hosts. The total block size is 256 addresses (2^8 = 256), with the first address reserved as the network address and the last address reserved as the broadcast address (256 - 2 = 254).

How many usable hosts are in a /26 subnet?

A /26 subnet contains exactly 62 usable hosts. The total block size is 64 addresses (2^6 = 64). Subtracting 2 for the network and broadcast addresses leaves 62 assignable IP addresses.

What subnet mask is /26?

The subnet mask for /26 is 255.255.255.192. In binary, the fourth octet contains two 1s (11000000), which equals 128 + 64 = 192.

What subnet mask is /32?

The subnet mask for /32 is 255.255.255.255. All 32 bits are binary 1s, leaving 0 host bits and representing a single specific IPv4 address.

How many IP addresses are in a /28?

A /28 subnet has 16 total IP addresses and 14 usable hosts. The host bits are 32 - 28 = 4, resulting in 2^4 = 16 total addresses and 16 - 2 = 14 usable endpoints.

How do I find the network address from an IP and subnet mask?

Convert the IP address and subnet mask to binary and perform a bitwise logical AND operation. Wherever both the IP bit and mask bit are 1, the resulting bit is 1; otherwise, it is 0. The resulting binary value converted back to decimal is the network address.

Frequently Asked Questions

A subnet calculator is an online networking tool that computes critical network boundary parameters from an IPv4 address and subnet mask or CIDR prefix. It instantly calculates the network address, broadcast address, first and last usable host addresses, total IP addresses, usable host count, and wildcard mask.
To calculate the network address, perform a bitwise logical AND operation between the 32-bit IPv4 address and the 32-bit subnet mask. Any bit position where both the IP address and the mask have a 1 produces a 1 in the network address, while all other bit positions become 0.
To calculate a subnet mask from CIDR notation, write out 32 binary bits with N ones followed by (32 - N) zeros. Divide the 32 bits into four 8-bit octets and convert each octet into decimal. For example, /24 has 24 ones followed by 8 zeros, which yields 255.255.255.0.
First find the host bits by subtracting the CIDR prefix from 32 (Host Bits = 32 - Prefix). For standard subnets, usable hosts equal 2^(Host Bits) - 2. The subtraction of 2 accounts for the reserved network address (first address) and broadcast address (last address). Special exceptions apply to /31 (2 usable hosts) and /32 (1 host).
A /32 subnet mask corresponds to 255.255.255.255 in decimal. It contains 32 network bits and 0 host bits, meaning it identifies exactly one single IPv4 address. It is widely used for router loopback interfaces, individual host routes, and specific firewall rules.
In subnetting context, 255.255.255.255 is the dotted-decimal representation of a /32 subnet mask, denoting a single host route. In routing context, 255.255.255.255 is also known as the "limited broadcast address," used by devices (such as DHCP clients) to broadcast to all devices on the local physical network segment.
A /24 subnet has 254 normally usable host addresses. With 8 host bits, the total number of IP addresses is 256 (2^8), and subtracting the network ID and broadcast ID leaves 254 assignable addresses (e.g., 192.168.1.1 through 192.168.1.254).
A /26 subnet has 62 normally usable host addresses. With 6 host bits (32 - 26 = 6), the total number of IP addresses is 64 (2^6), yielding 62 usable endpoints after excluding the network and broadcast addresses.
A subnet mask and CIDR prefix represent the exact same network boundary information using different formats. Subnet masks use four 8-bit dotted-decimal numbers (e.g., 255.255.255.0), whereas CIDR notation uses a compact forward slash followed by the count of leading network 1-bits (e.g., /24).
Yes. Our free IPv4 Subnet Calculator performs all network, broadcast, wildcard mask, and usable host calculations client-side in your browser instantly, without sending private IP data to external servers.