IP Subnet Calculator

IPv4 subnet details from an address and CIDR prefix: network, broadcast, usable host range, subnet mask, wildcard and host count.

Enter details

Network address

192.168.1.128/26

Broadcast address
192.168.1.191
Usable host range
192.168.1.129 – 192.168.1.190
Usable hosts
62
Subnet mask
255.255.255.192
Wildcard mask
0.0.0.63
Address type
Private (RFC 1918)

How network address changes with

Prefix length (/CIDR)
Prefix length (/CIDR): 13 → 192.168.0.0/1339 → Enter a valid IPv4 address and prefix 0–32

The dot is your current value. The graph updates as you type.

Formula: Mask = 2³² − 2^(32−prefix); Network = IP AND mask; Hosts = 2^(32−prefix) − 2

IP Subnet Calculator: IPv4 CIDR & Network Tool

Short answer

The IP Subnet Calculator determines IPv4 network boundaries, valid host ranges, subnet masks, and total capacity using an IP address and CIDR prefix. For example, entering 192.168.1.130 with a /26 prefix yields a network address of 192.168.1.128/26, 62 usable hosts spanning 192.168.1.129 to 192.168.1.190, and a broadcast address of 192.168.1.191.

Formula

Mask = 2³² − 2^(32−prefix); Network = IP AND mask; Hosts = 2^(32−prefix) − 2

Subnetting divides a 32-bit IPv4 address into network and host bits. The Subnet Mask is computed by setting the first n prefix bits to 1 and the remaining bits (32 − prefix) to 0, which translates algebraically to Mask = 2³² − 2^(32−prefix). The Network Address is determined by taking the bitwise logical AND between the binary IP address and the Subnet Mask (Network = IP AND Mask). Usable Hosts are calculated as 2^(32−prefix) − 2, deducting two addresses because the all-zeros host identifier represents the network itself and the all-ones host identifier represents the broadcast address.

Worked example

IP address
192.168.1.130
Prefix length (/CIDR)
26
  • Network address: 192.168.1.128/26
  • Broadcast address: 192.168.1.191
  • Usable host range: 192.168.1.129 – 192.168.1.190
  • Usable hosts: 62
  • Subnet mask: 255.255.255.192
  • Wildcard mask: 0.0.0.63
  • Address type: Private (RFC 1918)

How the IP Subnet Calculator Works

Every device connected to an Internet Protocol version 4 (IPv4) network relies on an IP address to send and receive data packets. An IPv4 address is a 32-bit binary number traditionally displayed in dotted-decimal format—four numbers ranging from 0 to 255 separated by periods (for example, 192.168.1.130). For a network to function, routing equipment must discern which portion of those 32 bits identifies the broader network (the routing prefix) and which portion identifies the unique device on that local segment (the host identifier).

The IP Subnet Calculator automates this separation using Classless Inter-Domain Routing (CIDR) logic and bitwise boolean mathematics. By entering an IPv4 address alongside its CIDR prefix length (the number of leading bits assigned to the network portion), the calculator generates the complete boundaries of the network block. This includes the canonical network address, the broadcast address, the range of valid client IP addresses, the decimal subnet mask, the wildcard mask, and the total usable capacity.

The Anatomy of an IPv4 Subnet Mask

A subnet mask is also a 32-bit sequence. Unlike an IP address, however, a standard subnet mask always consists of a contiguous run of binary 1s followed by a contiguous run of binary 0s.

  • Network Bits (Binary 1): Indicate the unchanging network prefix.
  • Host Bits (Binary 0): Indicate address space available for host assignment.

When you specify a prefix length such as /26, it dictates that the first 26 bits of the 32-bit address are binary 1s, leaving the remaining $32 - 26 = 6$ bits as binary 0s. In dotted-decimal form, 26 consecutive ones followed by 6 zeros translates to 255.255.255.192.

Mathematical Formulation of Subnetting

Subnetting relies on core binary arithmetic. The equations behind each value produced by the calculator are straightforward:

  1. Subnet Mask: $$\text{Mask} = 2^{32} - 2^{32 - \text{prefix}}$$ This integer calculation converts directly into the four 8-bit octets of the subnet mask.

  2. Network Address: $$\text{Network} = \text{IP} \text{ AND } \text{Mask}$$ Each bit of the IP address is evaluated against the corresponding bit of the subnet mask using a logical bitwise AND operation (where 1 AND 1 = 1, and all other combinations equal 0).

  3. Broadcast Address: $$\text{Broadcast} = \text{Network} \text{ OR } (\text{NOT } \text{Mask})$$ The bitwise NOT of the mask (also known as the wildcard mask) sets all host bits to 1. Combining this with the network address via a bitwise OR operation produces the highest possible address in the block.

  4. Usable Host Capacity: $$\text{Usable Hosts} = 2^{32 - \text{prefix}} - 2$$ The exponent $(32 - \text{prefix})$ represents the number of host bits $h$. Total addresses equal $2^h$. Because the first address represents the network identifier and the final address is reserved for broadcast traffic, standard subnets subtract 2.

Step-by-Step Worked Example

To see these mathematical principles in action, consider the exact input parameters:

  • IP address: 192.168.1.130
  • Prefix length (/CIDR): 26

Step 1: Convert IP and Prefix to Binary

First, convert the dotted-decimal IP address into 32 binary bits across four 8-bit octets:

  • 192 = 11000000
  • 168 = 10101000
  • 1 = 00000001
  • 130 = 10000010
  • Full IP in Binary: 11000000.10101000.00000001.10000010

A prefix of /26 means the first 26 bits are 1, and the final 6 bits are 0:

  • Mask in Binary: 11111111.11111111.11111111.11000000
  • Converting back to decimal octets gives the Subnet mask: 255.255.255.192.

Step 2: Compute the Network Address

Apply the bitwise AND operation between the binary IP and the binary mask:

  IP:   11000000.10101000.00000001.10000010 (192.168.1.130)
 Mask:  11111111.11111111.11111111.11000000 (255.255.255.192)
--------------------------------------------------------------
 Net:   11000000.10101000.00000001.10000000 (192.168.1.128)

The resulting Network address is 192.168.1.128/26.

Step 3: Compute the Wildcard Mask and Broadcast Address

Invert the subnet mask bits to derive the Wildcard mask:

  • Binary: 00000000.00000000.00000000.00111111
  • Decimal: 0.0.0.63

Apply the bitwise OR between the Network Address and the Wildcard Mask:

 Net:       11000000.10101000.00000001.10000000 (192.168.1.128)
 Wildcard:  00000000.00000000.00000000.00111111 (0.0.0.63)
--------------------------------------------------------------
 Bcast:     11000000.10101000.00000001.10111111 (192.168.1.191)

The resulting Broadcast address is 192.168.1.191.

Step 4: Determine Usable Host Range and Capacity

  • Host Bits ($h$): $32 - 26 = 6$
  • Total Addresses: $2^6 = 64$
  • Usable Hosts: $2^6 - 2 = 62$
  • First Usable Host: Network Address + 1 = 192.168.1.129
  • Last Usable Host: Broadcast Address − 1 = 192.168.1.190
  • Usable host range: 192.168.1.129 – 192.168.1.190

Step 5: Classify Address Scope

The IP address 192.168.1.130 falls squarely within the 192.168.0.0/16 boundary established by the Internet Engineering Task Force (IETF) in RFC 1918. Therefore, the calculator classifies the Address type as Private (RFC 1918).

How to Interpret Your Results

When reviewing outputs from the calculator, each metric serves a distinct administrative role:

  • Network Address: The formal base address representing the entire subnet in routing tables. You cannot assign this value to a network interface card (NIC), printer, or server.
  • Broadcast Address: A specialized address that relays incoming traffic to every device on that local subnet. Operating systems drop packets targeting this address if broadcast handling is restricted.
  • Usable Host Range: The exact inclusive window of IP addresses that can be statically assigned or distributed via Dynamic Host Configuration Protocol (DHCP) to host machines.
  • Usable Hosts: The total quantity of unique endpoints this subnet can support concurrently. If your physical equipment count exceeds this figure, you must expand the prefix (e.g., from /26 to /25).
  • Subnet Mask: The standard dotted-decimal representation required by network operating systems (such as Windows, Linux, and macOS) during static IP configuration.
  • Wildcard Mask: The inverse value required primarily when configuring packet filters, firewalls, and routing protocols like Open Shortest Path First (OSPF) on commercial routing platforms.
  • Address Type: Indicates whether the address is globally routable across the public internet or private within internal corporate and residential local area networks (LANs).

Modern Subnetting and VLSM Considerations

In modern network architecture, network administrators rarely allocate fixed subnet sizes across an entire organization. Instead, they use Variable Length Subnet Masking (VLSM). VLSM enables engineers to divide an assigned address block into subnets of varying sizes to match specific departmental needs.

For example, an office floor with 50 workstations requires a /26 subnet (providing 62 usable addresses), whereas a point-to-point router uplink connecting two buildings requires only a /30 (providing 2 usable addresses) or a /31 under RFC 3021. Implementing VLSM prevents address exhaustion and keeps routing tables streamlined.

Practical Tips

  • Use the "Magic Number" for Quick Mental Math: In the octet where the mask changes (the interesting octet), subtract the mask value from 256. For a /26 mask (255.255.255.192), compute $256 - 192 = 64$. The number 64 is your block size. Subnets in that octet will always start at multiples of 64: 0, 64, 128, 192. Because 130 falls between 128 and 191, the network address must be 128.
  • Standardize Default Gateway Placement: Establish a consistent organizational policy for gateway assignment. Most network engineers assign either the very first usable IP (192.168.1.129) or the very last usable IP (192.168.1.190) as the router's virtual interface address (HSRP/VRRP).
  • Plan for 30% Growth: When selecting a CIDR prefix, ensure the usable host count accommodates at least 20% to 30% overhead for new endpoints, smart phones, guest systems, and printers to avoid re-addressing segments later.
  • Separate Management and User Planes: Keep network infrastructure interfaces (switches, power distribution units, out-of-band management cards) on isolated subnets separate from general employee workstations to maintain security compliance.

Comparison

ScenarioInputResult
Base exampleDefault inputsNetwork address: 192.168.1.128/26

Common mistakes

  • Confusing total address capacity with usable host capacity by forgetting to subtract the network and broadcast addresses.
  • Assigning the network address or broadcast address directly to a physical host interface.
  • Incorrectly converting octets into binary, leading to off-by-one errors in block boundaries.
  • Assuming outdated classful network rules (Class A, B, C) apply when designing modern Classless Inter-Domain Routing (CIDR) networks.
  • Inverting bits improperly when calculating wildcard masks for router access control lists (ACLs).

Checklist

  • Verify the IPv4 address follows standard dotted-decimal notation (four octets between 0 and 255).
  • Select an appropriate CIDR prefix length between /0 and /32 based on host requirements.
  • Confirm whether the subnet uses RFC 1918 private space or publicly routable IP space.
  • Ensure total required devices do not exceed the calculated usable host capacity.
  • Reserve the first or last usable IP address for the default gateway router interface.
  • Document the calculated network, broadcast, and mask values in an IP Address Management (IPAM) system.
Michael Torres

Michael Torres

Co-Founder & Chief Editor

Michael Torres writes about personal finance, loans, and savings for the financial blog The Money Leads.

More about MichaelRead on The Money LeadsLast reviewed:

This tool provides mathematical calculations based on standard IPv4 specifications published by the Internet Engineering Task Force (IETF). Always verify your subnet allocations against your internal IP address management plan before deploying configuration changes to live production networks.

Frequently Asked Questions

Why do standard subnets lose two host addresses?

In standard IPv4 subnets, the very first address has all host bits set to binary 0 and is reserved as the network identifier. The final address has all host bits set to binary 1 and serves as the directed broadcast address for sending packets to all hosts on that local network segment. Because operating systems reserve these two functional addresses, neither can be assigned to individual endpoints, reducing usable capacity by two.

What is the difference between a subnet mask and a wildcard mask?

A subnet mask uses contiguous binary 1s to identify the network portion and 0s for the host portion. A wildcard mask is the bitwise inverse (NOT) of the subnet mask, featuring 0s where matching is required and 1s where bits can vary. Wildcard masks are predominantly used in Cisco IOS Access Control Lists (ACLs) and routing protocols like OSPF to specify matching address ranges across subnets.

What does CIDR notation represent?

Classless Inter-Domain Routing (CIDR) notation expresses an IP address alongside its subnet mask using a slash followed by the prefix length (e.g., /24). The integer indicates how many contiguous leading bits of the 32-bit IPv4 address are dedicated to the network prefix. CIDR replaced rigid, wasteful Class A, B, and C address assignments in 1993, allowing variable-length subnetting and efficient IP routing table aggregation worldwide.

Can point-to-point links use /31 subnets without losing two hosts?

Yes, under RFC 3021, point-to-point links can safely utilize /31 subnet masks (255.255.255.254), which provide exactly two IP addresses. Because only two endpoints exist on a dedicated point-to-point link, directed broadcast is unnecessary, and packets sent to the higher address reach the opposite endpoint. Modern enterprise and carrier-grade routers support RFC 3021 to prevent the address waste typical of traditional /30 point-to-point allocations.

What address blocks are designated as RFC 1918 private space?

The Internet Engineering Task Force (IETF) established RFC 1918 to reserve three specific blocks for private networks: 10.0.0.0/8 (10.0.0.0 to 10.255.255.255), 172.16.0.0/12 (172.16.0.0 to 172.31.255.255), and 192.168.0.0/16 (192.168.0.0 to 192.168.255.255). These addresses are not routable across the public global internet. Devices using private addresses require Network Address Translation (NAT) on an edge router or firewall to communicate externally.

How does subnetting improve network security and performance?

Subnetting splits large networks into isolated broadcast domains, preventing local broadcast storms from degrading network performance across unrelated segments. Subnets also establish clear administrative boundaries. Network engineers can place security controls—such as firewalls, intrusion detection systems, and access control lists—between subnets. This containment restricts unauthorized lateral movement across departments, separates guest traffic from sensitive corporate databases, and optimizes overall routing efficiency across switches and routers.

Sources & references

Formulas are tested against hand-checked answers. How we check our calculators.

Estimates only. Confirm final figures, terms and fees with your bank, provider or a qualified professional.

Last updated: January 15, 2026