Try

Subnet Calculator

IPv4 network, broadcast, mask, host range and usable hosts from CIDR.

Network address

192.168.1.0 /24

254 usable hosts

Subnet mask

255.255.255.0

Broadcast

192.168.1.255

Usable hosts

254

Host range

192.168.1.1 – 192.168.1.254

Total addresses

256

Wildcard

0.0.0.255

AI Breakdown & Smart Takeaway

Plain-English insight on your numbers

Get a personalized explanation of what these results mean — and how to improve them.

AdvertisementAd space

How the Subnet Calculator works

The GKCalculators Subnet Calculator takes any IPv4 address and CIDR prefix length (or netmask) and instantly returns the network address, broadcast address, subnet mask, usable host range, and total number of hosts — making it indispensable for network engineers, sysadmins, students, and anyone planning or troubleshooting an IP network.

When you enter an IPv4 address alongside a CIDR prefix (such as 192.168.1.45/24), the calculator first converts both values into 32-bit binary. The prefix length tells it how many of those 32 bits belong to the network portion and how many remain for host addressing. A /24, for example, locks the first 24 bits as the network identifier, leaving 8 bits — 256 possible addresses — for hosts within that subnet. Changing the CIDR value by even one bit either halves or doubles the subnet size, which is why CIDR notation is so powerful for efficient address allocation.

To derive the network address, the tool performs a bitwise AND between the host IP and the subnet mask. The subnet mask itself is constructed by setting the first N bits to 1 and the remaining bits to 0 (where N is your prefix length), then converting that binary string to dotted-decimal — /24 becomes 255.255.255.0, /20 becomes 255.255.240.0, and so on. The broadcast address is the opposite extreme: it is calculated by OR-ing the network address with the inverted mask (all host bits set to 1). Every device on the subnet can send traffic to this special broadcast address simultaneously.

The usable host range sits between the network address (which identifies the subnet itself) and the broadcast address (reserved for layer-2 broadcasts). The formula for usable hosts is 2^(32−prefix) − 2, subtracting those two reserved addresses. A /30 subnet, often used for point-to-point WAN links, yields exactly 2 usable hosts from its 4-address block. Conversely, a /22 gives you 1,022 usable hosts across a 1,024-address block — a common choice for medium-sized office LANs. Understanding this tradeoff between prefix length and host capacity is the core skill in IP address planning.

A frequent mistake is confusing the host IP entered with the network address. If you type 10.0.0.37/26, the network address is 10.0.0.0 — not 10.0.0.37 — because the last 6 host bits of .37 are masked away. Another common error is choosing subnets that are too large, wasting thousands of addresses, or too small, requiring painful renumbering later. Best practice is to estimate peak host count, add a 20–30% growth buffer, and then select the smallest CIDR block that comfortably accommodates that number. The calculator makes it trivial to iterate through candidate prefix lengths until you find the right fit.

Formula

Network = IP AND Mask · Hosts = 2^(32−prefix) − 2

Pro tips

  • Start with your required host count, not the prefix. Calculate 2^(32−prefix) − 2 for several candidates and pick the smallest block that fits your hosts plus a growth buffer of at least 25%.
  • Use /30 (2 usable hosts) for point-to-point links between routers — it wastes only 2 addresses versus the 254 wasted by a /24 on the same link.
  • When subnetting a larger block, remember that each subnet's network address must align to a multiple of its block size. A /26 (64 addresses) within 10.0.0.0/24 must start at .0, .64, .128, or .192 — never .10 or .50.
  • Always document your subnet allocations in a spreadsheet or IPAM tool. Running this calculator on each planned subnet and recording results prevents overlapping ranges, which cause silent routing failures.
  • For IPv6 planning, note that this calculator is IPv4-specific. IPv6 subnets almost always use /64 for LANs, so separate tools are appropriate; don't try to apply IPv4 subnet math directly to IPv6 prefixes.

Key terms

CIDR (Classless Inter-Domain Routing)
— A compact notation (e.g., /24) appended to an IPv4 address that specifies how many leading bits define the network portion, replacing the older class-based A/B/C system.
Subnet Mask
— A 32-bit value written in dotted-decimal (e.g., 255.255.255.0) that separates the network bits from the host bits in an IPv4 address.
Network Address
— The first address in a subnet, derived by AND-ing the IP with the subnet mask; it identifies the subnet itself and cannot be assigned to a host.
Broadcast Address
— The last address in a subnet, where all host bits are set to 1; packets sent here are delivered to every device on the subnet.
Usable Host Range
— The set of IPv4 addresses between the network address and broadcast address (exclusive) that can be assigned to individual network interfaces.
Prefix Length
— The integer (0–32) in CIDR notation that indicates how many bits of a 32-bit IPv4 address are fixed as the network identifier.

Frequently asked questions