Skip to content
Calixo

IPv4 Subnet Calculator

Find the network address, broadcast address and usable host range for an IP address and subnet mask — the essential subnet-boundary calculation for network configuration.

Inputs

Paste this into any page — the widget stays live and updates automatically as this calculator improves. Using WordPress or Notion? See the embed guide.

Saved Scenarios

— select 2+ to compare
Inputs updated · Results recalculated · Just now

Network Address

192.168.1.0

Broadcast Address

192.168.1.255

Subnet Mask

255.255.255.0

First Usable Host

192.168.1.1

Last Usable Host

192.168.1.254

Total Addresses

256

Usable Hosts

254

Spark says

Detailed shot of Ethernet cables connected to server ports highlighting technology infrastructure.
Photo by Brett Sayles on Pexels
From above of optical switch equipment with many similar connectors with rubber cables and metal parts
Photo by Brett Sayles on Pexels

Formula

Network=IP  &  Mask,Broadcast=Network    ¬MaskNetwork = IP \;\&\; Mask, \quad Broadcast = Network \;|\; \lnot Mask
Mask
— The 32-bit subnet mask derived from the CIDR prefix

What is the IPv4 Subnet Calculator?

Given any IP address and CIDR prefix, this calculator works out the containing subnet's boundaries — the network address (all host bits zero), broadcast address (all host bits one), and the usable range in between.

Use this when configuring a router, firewall, or DHCP server and need to know a subnet's exact boundaries, troubleshooting why a device can't communicate with others on what should be the same network, or verifying whether two IP addresses actually fall within the same subnet.

How to use it

  1. 1 Enter an IP address inside the subnet.
  2. 2 Enter the CIDR prefix length (the /N in an address like 192.168.1.0/24).

Understanding IPv4 Subnet Calculator

Every IPv4 subnet has a mathematically fixed set of special addresses that this calculator reveals — the network address, the broadcast address, and the range of addresses actually usable by real devices in between — and understanding how these are derived from bitwise operations on the IP address and subnet mask is genuinely useful for anyone doing hands-on network configuration or troubleshooting, beyond just knowing that a calculator can produce the answer.

The core operation is a bitwise AND between the IP address and the subnet mask, which zeroes out all the host-portion bits while preserving the network-portion bits — this produces the network address, the subnet's canonical identifier. Because a bitwise AND with a mask bit of 1 preserves the corresponding address bit while a mask bit of 0 forces the result to 0, and the subnet mask's network-portion bits are all 1s while its host-portion bits are all 0s, this operation cleanly separates 'which network is this address part of' from 'which specific host within that network.' The broadcast address, by contrast, comes from taking the network address and setting every host-portion bit to 1 (the inverse operation, effectively) — representing the special address used to send a single packet to every device on that subnet simultaneously.

This bitwise-operation foundation is exactly why two IP addresses that look superficially similar in decimal notation can actually belong to entirely different subnets, or conversely why two addresses that look quite different in decimal can belong to the same subnet — decimal representation doesn't directly reveal the underlying binary network/host boundary the way examining the actual bits does. This is a genuine, common source of network troubleshooting confusion: an engineer glancing at two IP addresses and assuming they're 'close enough' to be on the same network, when the actual subnet mask places the boundary somewhere that puts them in genuinely different networks, unable to communicate directly without routing through a gateway.

Practically, this calculation matters most directly for two everyday networking tasks. First, static IP assignment: any device manually configured with a static IP address needs that address to fall within the subnet's usable host range — not the network address (which identifies the subnet, not a device) and not the broadcast address (which is reserved for subnet-wide messaging) — and accidentally assigning either of those two special addresses to a device is a classic, easily-made configuration mistake that breaks that device's connectivity in a way that can be genuinely confusing to diagnose without understanding what those two boundary addresses actually represent. Second, connectivity troubleshooting: when two devices that should be able to communicate directly can't, checking whether they're actually within the same calculated subnet (same network address, given their respective IPs and masks) is one of the first and most useful diagnostic steps, since devices on different subnets require a router to communicate, and a subnet-configuration mismatch (one device configured with a different mask than intended, placing it in a different effective network) is a common, sometimes-overlooked root cause of exactly this kind of connectivity failure.

Worked examples

Advantages

  • Computes all key subnet boundaries — network, broadcast, and usable range — from a single IP and prefix input.
  • Works for any IP address within a subnet, not just the network's first address.
  • Essential for network troubleshooting, configuration, and planning tasks.
  • Clarifies the exact usable address range available for host assignment.

Limitations

  • For /31 and /32 subnets, the standard network/broadcast reservation doesn't apply the same way (point-to-point links and single hosts use special conventions) — usable host count is shown as 0 in those cases per the general formula.

Common mistakes

  • ⚠️ Assuming two devices are on the same subnet just because their IP addresses look visually similar, without actually checking whether they fall within the same calculated network and broadcast address range.
  • ⚠️ Configuring a device with an IP address that falls outside its intended subnet's usable range, often the network or broadcast address itself, which prevents normal host communication.
  • ⚠️ Misreading a subnet mask (like 255.255.255.0) and manually miscalculating the corresponding network boundaries, a common source of network configuration errors that a direct calculation avoids.

Tips

  • 💡 When troubleshooting connectivity between two devices, always verify both are within the same calculated network and broadcast address range before assuming a subnet mismatch isn't the issue.
  • 💡 Double-check that a statically assigned IP address falls within the usable host range (not the network or broadcast address) before deploying it to a device.
  • 💡 For network documentation, record the CIDR prefix explicitly alongside any IP address, since the same address can belong to very different subnets depending on the prefix length.
  • 💡 Use this calculator to independently verify a router or firewall's reported subnet configuration, especially when troubleshooting an unexpected connectivity issue.

Real-life uses

  • Configuring a router, firewall, or DHCP server that requires exact subnet boundaries
  • Troubleshooting why a device can't communicate with others on what should be the same network
  • Verifying whether two IP addresses fall within the same subnet
  • Planning static IP address assignment within a subnet's usable range

Frequently asked questions

What's the difference between this and the CIDR Calculator?

Same underlying math — this one takes the IP address and prefix as separate fields; the CIDR Calculator accepts them combined as a single 'IP/prefix' string, matching how CIDR blocks are usually written.

How is the network address actually calculated?

Through a bitwise AND between the IP address and the subnet mask — this zeroes out all host-portion bits while preserving the network-portion bits, producing the subnet's canonical network identifier.

Why might two IP addresses that look similar actually be on different subnets?

Decimal notation doesn't directly reveal the underlying binary network/host boundary — the subnet mask determines exactly where that boundary falls, and two addresses can look visually close in decimal while actually belonging to different networks based on the mask.

What happens if I assign a device the network or broadcast address?

The device won't function correctly on the network — the network address identifies the subnet itself rather than a specific host, and the broadcast address is reserved for subnet-wide messaging, so neither is a valid individual host address.

Why would two devices that should communicate directly fail to connect?

A common cause is a subnet mask mismatch — if one device is configured with a different mask than intended, it may calculate a different effective network boundary, placing it in a different subnet than the other device even if their IP addresses look numerically close.