IPv4 Subnet Mask Calculator

Calculate IPv4 network boundaries, broadcast addresses, usable host IP ranges, CIDR prefix lengths, wildcard masks, and 32-bit binary boolean bit allocations.

Network Architecture & Binary Boolean Masking Engine
Standard dotted decimal (4 octets: 0–255)
Bit length of the network routing prefix
Identified Subnet Network
192.168.1.0 /24
Usable Hosts: 192.168.1.1 — 192.168.1.254
Subnet Mask 255.255.255.0 Dotted decimal format
Wildcard Inverse Mask 0.0.0.255 ACL & OSPF routing mask
Directed Broadcast Address 192.168.1.255 All host bits set to 1
Usable Host Capacity 254 Hosts 256 total IP addresses
Address Class Class C Private Non-Routable (RFC 1918)
Binary Prefix Ratio 24 Net / 8 Host 32 bits total length

32-Bit Binary Boolean Bit Allocation

Network Bits (1s) Host Bits (0s)
IP Address 11000000.10101000.00000001.00000001
Subnet Mask
Network Address 11000000.10101000.00000001.00000000
Broadcast Address 11000000.10101000.00000001.11111111

Subnet Sub-Division & VLSM Scaling Table

Subnet Prefix Subnet Mask Total Subnets Total IPs / Subnet Usable Hosts

IPv4 Network Architecture, Binary Boolean Masking & VLSM Subnetting

In telecommunications and computer networking, the Internet Protocol Version 4 (IPv4) architecture structures communication over packet-switched networks using 32-bit logical addresses. Subnetting systematically partitions a monolithic network into smaller, topologically isolated routing domains—optimizing broadcast traffic containment, routing table convergence, and address allocation efficiency.

The 32-Bit Dual-Field Topology

An IPv4 address comprises 32 contiguous binary bits grouped into four 8-bit octets separated by decimal periods. A subnet mask divides this 32-bit vector into a Network Prefix of length $p$ bits (identifying the administrative routing domain) and a Host Field of length $32 - p$ bits (identifying discrete host network interfaces).

$$\text{Total Bits} = \underbrace{b_1 b_2 \dots b_p}_{\text{Network Identification Bits}} \quad \underbrace{b_{p+1} b_{p+2} \dots b_{32}}_{\text{Host Identification Bits}} = 32 \text{ bits}$$

Boolean Algebraic Network & Broadcast Derivation

Routers identify the base Network Address by performing a bitwise logical AND operation ($\land$) between the 32-bit IP address vector and the Subnet Mask vector:

$$\mathbf{NetID} = \mathbf{IP} \land \mathbf{Mask}$$

The Directed Broadcast Address (which addresses all hosts on the subnet simultaneously) is derived by setting all host field bits to binary 1, equivalent to a bitwise logical OR ($\lor$) with the bitwise NOT ($\neg$) of the mask:

$$\mathbf{Broadcast} = \mathbf{IP} \lor (\neg \mathbf{Mask})$$

Host Capacity & Usable Address Formulas

For a given Classless Inter-Domain Routing (CIDR) prefix length $p$ ($1 \le p \le 32$), the total address capacity $N_{\text{total}}$ and usable host address capacity $N_{\text{usable}}$ evaluate to:

$$N_{\text{total}} = 2^{32 - p}, \qquad N_{\text{usable}} = \max\left(0, 2^{32 - p} - 2\right)$$

The subtraction of $2$ accounts for the reserved base Network Address (all host bits $0$) and the Broadcast Address (all host bits $1$). Point-to-point links using $/31$ subnetting adhere to RFC 3021 which permits 2 usable hosts without broadcast reservation.

Classful IPv4 Boundaries vs. RFC 1918 Private Scopes

Address Classification Leading Bits / Range Default Mask RFC 1918 Private Non-Routable Range
Class A $0\dots$ (1.0.0.0 – 126.255.255.255) 255.0.0.0 (/8) 10.0.0.0 /8 (10.0.0.0 – 10.255.255.255)
Class B $10\dots$ (128.0.0.0 – 191.255.255.255) 255.255.0.0 (/16) 172.16.0.0 /12 (172.16.0.0 – 172.31.255.255)
Class C $110\dots$ (192.0.0.0 – 223.255.255.255) 255.255.255.0 (/24) 192.168.0.0 /16 (192.168.0.0 – 192.168.255.255)
Class D (Multicast) $1110\dots$ (224.0.0.0 – 239.255.255.255) N/A (Group Address) 239.0.0.0 /8 (Administratively Scoped)

Step-by-Step Subnet Calculation Example

Analyze the host IP address 192.168.10.77 with CIDR prefix /26:

  1. Prefix & Subnet Mask: Prefix $p = 26$. The mask contains 26 consecutive ones followed by 6 zeros: $$11111111.11111111.11111111.11000000_2 = \mathbf{255.255.255.192}$$
  2. Wildcard Mask (Bit Inversion): $$255.255.255.255 - 255.255.255.192 = \mathbf{0.0.0.63}$$
  3. 4th Octet Boolean AND: $$77_{10} = 01001101_2, \quad 192_{10} = 11000000_2 \implies 01001101_2 \land 11000000_2 = 01000000_2 = 64_{10}$$ $$\mathbf{Network Address} = \mathbf{192.168.10.64}$$
  4. Broadcast Address Calculation: $$64 + 63 = 127 \implies \mathbf{Broadcast Address} = \mathbf{192.168.10.127}$$
  5. Usable Host Range: $\mathbf{192.168.10.65}$ through $\mathbf{192.168.10.126}$ ($2^{32-26} - 2 = 64 - 2 = \mathbf{62 \text{ usable hosts}}$).
Advertisement
Google AdSense Bottom Banner • 728 × 90 / Responsive Matched
AD
Institutional Wealth & Health Analytics Platform
Empower your decision making with professional tools. Visit Official Partner.