Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Network Address
192.168.1.128
/26
Broadcast Address 192.168.1.191
Subnet Mask 255.255.255.192
First Usable Host 192.168.1.129
Last Usable Host 192.168.1.190
Usable Hosts 62
Total Addresses 64

What this calculator does

This tool takes an IPv4 address and a CIDR prefix length (the number after the slash, e.g. /26) and computes the subnet's key parameters: the network address, the broadcast address, the subnet mask in dotted-quad form, the first and last usable host addresses, and the total and usable host counts. It works for any prefix from /0 to /32 and is useful for network design, firewall rules, and exam practice.

How to use it

Enter an IPv4 address such as 192.168.1.130 and a prefix length such as 26. Submit to see the full breakdown. The calculator treats the address as a 32-bit number, applies the mask with bitwise operations, and converts the results back to dotted decimal.

The formula explained

A CIDR prefix of n means the first n bits are network bits, so the subnet mask is n ones followed by (32 − n) zeros. The network address is IP AND mask, which zeroes out the host bits. The broadcast address is network OR (NOT mask), which sets every host bit to 1. Total addresses equal 2^(32 − n); usable hosts are total minus 2 (one for the network, one for broadcast) for prefixes up to /30.

$$ \begin{gathered} \text{Network} = \text{IP} \,\&\, M, \qquad \text{Broadcast} = \text{Network} \mid \lnot M \\[1.5em] \text{where}\quad \left\{ \begin{aligned} \text{IP} &= \text{IP Address} \\ M &= \texttt{0xFFFFFFFF} \ll \left(32 - \text{Prefix}\right) \\ \text{Total Hosts} &= 2^{\,32 - \text{Prefix}} \\ \text{Usable Hosts} &= 2^{\,32 - \text{Prefix}} - 2 \end{aligned} \right. \end{gathered} $$
Diagram of a 32-bit IPv4 address divided into network bits and host bits at the CIDR boundary
The CIDR prefix sets where the network portion ends and the host portion begins.

Worked example

For 192.168.1.130/26: the /26 mask is 255.255.255.192. The last octet 130 AND 192 = 128, so the network is 192.168.1.128. The block size is 64, so the broadcast is 192.168.1.191. Usable range is 192.168.1.129 to 192.168.1.190, giving 62 usable hosts out of 64 total addresses.

$$ 130 \,\&\, 192 = 128 $$ $$ \text{Total Hosts} = 2^{\,32 - 26} = 2^{6} = 64 $$ $$ \text{Usable Hosts} = 2^{6} - 2 = 62 $$
Range bar showing network address at the start, broadcast address at the end, and usable hosts in between
The network address is the first address, the broadcast the last, with usable hosts in between.

FAQ

Why do /31 and /32 behave differently? A /32 is a single host; a /31 (RFC 3021) uses both addresses for point-to-point links, so neither subtracts the network/broadcast pair.

What is the subnet mask for /24? /24 is 255.255.255.0, giving 256 total and 254 usable hosts.

Is this IPv6 compatible? No — this calculator is for IPv4 addresses only.

Last updated: